Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 0a795e3

Browse files
authored
migrate to analyzer 2.8.0 (#3077)
* migrate to analyzer 2.8.0 * fix test expectations
1 parent bb29c70 commit 0a795e3

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

lib/src/rules/comment_references.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ class _Visitor extends SimpleAstVisitor<void> {
9595

9696
@override
9797
void visitCommentReference(CommentReference node) {
98-
var identifier = node.identifier;
99-
if (!identifier.isSynthetic && identifier.staticElement == null) {
100-
rule.reportLint(identifier);
98+
var expression = node.expression;
99+
if (expression.isSynthetic) return;
100+
if (expression is Identifier && expression.staticElement == null) {
101+
rule.reportLint(expression);
101102
}
102103
}
103104

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ environment:
1212
sdk: '>=2.12.0 <3.0.0'
1313

1414
dependencies:
15-
analyzer: '>=2.7.0 <3.0.0'
15+
analyzer: '>=2.8.0 <3.0.0'
1616
args: ^2.0.0
1717
collection: ^1.15.0
1818
glob: ^2.0.0

test/integration/secure_pubspec_urls.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ void main() {
3737
stringContainsInOrder([
3838
'pubspec.yaml 4:11 [lint] The url should only only use secure protocols.',
3939
'pubspec.yaml 14:12 [lint] The url should only only use secure protocols.',
40+
'pubspec.yaml 19:13 [lint] The url should only only use secure protocols.',
4041
'pubspec.yaml 27:12 [lint] The url should only only use secure protocols.',
4142
'pubspec.yaml 31:12 [lint] The url should only only use secure protocols.',
42-
'1 file analyzed, 4 issues found',
43+
'1 file analyzed, 5 issues found',
4344
]));
4445
expect(exitCode, 1);
4546
});

test/mocks.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ class MockSource extends BasicSource {
111111
@override
112112
TimestampedData<String> get contents => TimestampedData<String>(0, '');
113113

114-
@override
115-
UriKind get uriKind => UriKind.FILE_URI;
116-
117114
@override
118115
bool exists() => false;
119116

test/rules/super_goes_last.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class SuperGoesLastTest extends LintRuleTest {
1717
@override
1818
String get lintRule => 'super_goes_last';
1919

20-
@FailingTest(issue: 'https://github.com/dart-lang/linter/issues/3069')
2120
test_invalidSuperInvocation() async {
2221
await assertDiagnostics(r'''
2322
class A {
@@ -33,9 +32,7 @@ class C extends A {
3332
3433
''', [
3534
error(HintCode.UNUSED_FIELD, 61, 2),
36-
// Update to `SUPER_INVOCATION_NOT_LAST` when analyzer 2.8.0+ is published
37-
// https://github.com/dart-lang/linter/issues/3069
38-
// error(CompileTimeErrorCode.INVALID_SUPER_INVOCATION, 84, 5),
35+
error(CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, 84, 5),
3936
lint('super_goes_last', 84, 8),
4037
]);
4138
}

0 commit comments

Comments
 (0)