Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 7a40cb3

Browse files
authored
fix: correctly handle empty comment sentence for format-comment (#1159)
1 parent ab95f02 commit 7a40cb3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* feat: add `allow-initialized` option to [`avoid-late-keyword`](https://dcm.dev/docs/individuals/rules/common/avoid-late-keyword).
1414
* feat: add `ignored-types` option to [`avoid-late-keyword`](https://dcm.dev/docs/individuals/rules/common/avoid-late-keyword).
1515
* fix: support tear-off methods for `check-unnecessary-nullable`.
16+
* fix: correctly handle empty comment sentence for [`format-comment`](https://dcm.dev/docs/individuals/rules/common/format-comment).
1617
* feat: support type=lint suppression.
1718

1819
## 5.4.0

lib/src/analyzers/lint_analyzer/rules/rules_list/format_comment/visitor.dart

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class _Visitor extends RecursiveAstVisitor<void> {
110110

111111
bool _isValidSentence(String sentence) {
112112
final trimmedSentence = sentence.trim();
113+
if (trimmedSentence.isEmpty) {
114+
return true;
115+
}
113116

114117
final upperCase = trimmedSentence[0] == trimmedSentence[0].toUpperCase();
115118
final lastSymbol =

0 commit comments

Comments
 (0)