This repository was archived by the owner on Jul 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ * fix: correctly support dartdoc tags for [ ` format-comment ` ] ( https://dcm.dev/docs/individuals/rules/common/format-comment ) .
6
+
3
7
## 5.6.0-dev.1
4
8
5
9
* docs: remove old website
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ part of 'format_comment_rule.dart';
3
3
const _punctuation = ['.' , '!' , '?' , ':' ];
4
4
5
5
final _sentencesRegExp = RegExp (r'(?<=([\.|:](?=\s|\n|$)))' );
6
- final _regMacrosExp = RegExp ('{@(template|macro) .+}' );
7
- const _macrosEndExp = '{@endtemplate}' ;
6
+ final _regMacrosExp = RegExp ('{@.+}' );
8
7
const _ignoreExp = 'ignore:' ;
9
8
const _ignoreForFileExp = 'ignore_for_file:' ;
10
9
@@ -141,16 +140,14 @@ class _Visitor extends RecursiveAstVisitor<void> {
141
140
final trimmed = text.trim ();
142
141
143
142
return _regMacrosExp.hasMatch (text) ||
144
- text.contains (_macrosEndExp) ||
145
143
_isIgnoreComment (trimmed) ||
146
144
_isIgnoredPattern (trimmed);
147
145
}
148
146
149
147
bool _isIgnoreComment (String text) =>
150
148
text.startsWith (_ignoreExp) || text.startsWith (_ignoreForFileExp);
151
149
152
- bool _isMacros (String text) =>
153
- _regMacrosExp.hasMatch (text) || text == _macrosEndExp;
150
+ bool _isMacros (String text) => _regMacrosExp.hasMatch (text);
154
151
155
152
bool _isIgnoredPattern (String text) =>
156
153
_ignoredPatterns.any ((regExp) => regExp.hasMatch (text));
Original file line number Diff line number Diff line change @@ -28,3 +28,6 @@ void f3() {}
28
28
29
29
/// {@template my_project.my_class.my_method}
30
30
void f4 () {}
31
+
32
+ /// {@nodoc}
33
+ void f5 () {}
You can’t perform that action at this time.
0 commit comments