* Fix flaky Windows dart analyze; enforce dart_code_linter on test/
Drop the dart_code_linter analyzer `plugin` registration from
analysis_options.yaml. When registered, `dart analyze` loaded the plugin
in a separate isolate that re-emitted the `dart_code_linter:` rules as
diagnostics over the plugin protocol for all non-excluded files. Delivery
of those diagnostics to the CLI is asynchronous and racy, so on slower
Windows CI runners they intermittently appeared and `--fatal-infos` turned
them fatal -- a flaky, platform-specific failure (#144). `dart analyze` now
enforces only core lints, deterministically across platforms.
The dedicated `dart run dart_code_linter:metrics` step is the deterministic
enforcement path for those rules; extend it to cover `test` as well as
`lib` so the test suite gets real, cross-platform coverage instead of the
accidental flaky version.
Fix the test-file violations this surfaces:
- avoid-late-keyword: replace `late Directory tempDir` fixtures with a
shared createTempDir() helper that registers cleanup via addTearDown,
removing duplicated tearDown blocks.
- avoid-dynamic: `dynamic noSuchMethod` -> `Object?`.
- avoid-redundant-async: drop the redundant async in a setUp.
Exclude prefer-match-file-name for test/**: test files must be named
`*_test.dart` and commonly hold several small fixture classes, so they
cannot match the rule's "file name == first class name" convention.
* Exclude avoid-late-keyword for tests instead of placeholder workaround
Address review feedback: rather than initializing tempDir fixtures to a
placeholder to satisfy avoid-late-keyword, exclude the rule for test/**
(as already done for prefer-match-file-name). `late` for fields assigned
in setUp is the idiomatic Dart test pattern. Reverts the createTempDir
helper and placeholder initializations; fixtures are plain `late` again.
The genuine, non-late fixes are kept: avoid-dynamic (Object? noSuchMethod)
and avoid-redundant-async (drop async from a sync setUp).
* Apply suggestion from @reidbaker
* Add CI line-coverage gate for dart_skills_lint
Collect coverage with `dart test --coverage`, convert to LCOV via the
already-transitive package:coverage, and enforce a minimum threshold in
CI with the VeryGoodOpenSource/very_good_coverage action (min 73%,
excluding *.g.dart). Adds contributor docs and a CHANGELOG entry. No new
pub dependencies and no custom coverage parsing to maintain.
* Document --ignore-files to exclude *.g.dart from local coverage
Adds a GitHub Actions workflow to automatically run CI checks for the skills CLI tool. Tests are run on both Ubuntu, Mac and Windows for the `stable` and `dev` Dart SDK channels. The workflow triggers on pushes and pull requests to the main branch that modify the `tool/` directory, and runs:
- `dart pub get`
- `dart analyze --fatal-infos`
- `dart format` (on the dev channel only)
- `dart test` - is currently omitted as the test suite needs to be refactored to work properly without relying on real API keys in the CI environment
https://github.com/flutter/flutter/issues/183124