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 +10
-1
lines changed
lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_redundant_async
test/src/analyzers/lint_analyzer/rules/rules_list/avoid_redundant_async/examples Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1414* feat: ** Breaking change** cleanup public API.
1515* chore: restrict ` analyzer ` version to ` >=5.1.0 <5.3.0 ` .
1616* feat: add ` print-config ` option to all commands.
17+ * fix: ignore ` @override ` methods for [ ` avoid-redundant-async ` ] ( https://dartcodemetrics.dev/docs/rules/common/avoid-redundant-async ) .
1718
1819## 4.21.2
1920
Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ class _Visitor extends RecursiveAstVisitor<void> {
99 void visitMethodDeclaration (MethodDeclaration node) {
1010 super .visitMethodDeclaration (node);
1111
12- if (_hasRedundantAsync (node.body)) {
12+ final isOverride = node.metadata.any (
13+ (node) =>
14+ node.name.name == 'override' && node.atSign.type == TokenType .AT ,
15+ );
16+
17+ if (! isOverride && _hasRedundantAsync (node.body)) {
1318 _declarations.add (node);
1419 }
1520 }
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ class SomeClass {
2121 // LINT
2222 Future <String > anotherAsyncMethod () async => Future .value ('value' );
2323
24+ @override
25+ Future <String > overrideMethod () async => Future .value ('value' );
26+
2427 Future <String > someAsyncMethod (Future <String > later) => later;
2528
2629 Future <void > report (Iterable <String > records) async {
You can’t perform that action at this time.
0 commit comments