Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/dart_skills_lint_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: dart analyze --fatal-infos

- name: Run cyclomatic complexity check
run: dart run dart_code_linter:metrics analyze lib
run: dart run dart_code_linter:metrics analyze lib test

- run: dart test

Expand Down
18 changes: 14 additions & 4 deletions tool/dart_skills_lint/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
plugins:
- dart_code_linter
# dart_code_linter is intentionally NOT registered as an analyzer
# `plugin` here. When it was, `dart analyze` had racy false positives.
# See https://github.com/flutter/skills/issues/144
errors:
# allow deprecated members (we do this because otherwise we have to annotate
# every member in every test, assert, etc, when we or the Dart SDK deprecates
Expand Down Expand Up @@ -286,11 +287,20 @@ dart_code_linter:
- no-empty-block
- avoid-redundant-async
- avoid-passing-async-when-sync-expected
- avoid-late-keyword
# `late` for fields initialized in `setUp` is the idiomatic Dart test
# fixture pattern; enforce this rule on lib only.
- avoid-late-keyword:
exclude:
- test/**
- prefer-named-record-fields

# Clean up
- avoid-unused-parameters
- prefer-moving-to-variable
- prefer-match-file-name
# Test files must be named `*_test.dart` for the test runner, and commonly
# hold several small fixture/mock classes, so they can never match this
# rule's "file name == first class name" convention. Enforce it on lib only.
- prefer-match-file-name:
exclude:
- test/**
Comment thread
reidbaker marked this conversation as resolved.
- always-remove-listener
2 changes: 1 addition & 1 deletion tool/dart_skills_lint/test/directory_structure_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MockInaccessibleFile implements File {
}

@override
dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
Object? noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

base class TestIOOverrides extends IOOverrides {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void main() {
late Directory tempDir;
late SkillsIgnoresStorage storage;

setUp(() async {
setUp(() {
tempDir = Directory.systemTemp.createTempSync('storage_test.');
storage = SkillsIgnoresStorage();
});
Expand Down
Loading