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

fix: correctly handle empty comment sentence for format-comment #1159

Merged
merged 2 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* feat: add `allow-initialized` option to [`avoid-late-keyword`](https://dcm.dev/docs/individuals/rules/common/avoid-late-keyword).
* feat: add `ignored-types` option to [`avoid-late-keyword`](https://dcm.dev/docs/individuals/rules/common/avoid-late-keyword).
* fix: support tear-off methods for `check-unnecessary-nullable`.
* fix: correctly handle empty comment sentence for [`format-comment`](https://dcm.dev/docs/individuals/rules/common/format-comment).
* feat: support type=lint suppression.

## 5.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class _Visitor extends RecursiveAstVisitor<void> {

bool _isValidSentence(String sentence) {
final trimmedSentence = sentence.trim();
if (trimmedSentence.isEmpty) {
return true;
}

final upperCase = trimmedSentence[0] == trimmedSentence[0].toUpperCase();
final lastSymbol =
Expand Down