* Fix dart_hooks.yaml example keys so hooks are actually enabled (#150)
The example dart_hooks.yaml files committed in #148 used the script
filenames (agent_dart_format.dart / agent_dart_analyze.dart) as keys.
BaseHook.run() gates on each hook's configKey, which is the class name
(DartFormatHook / DartAnalyzeHook), so copying these files left both
hooks silently disabled, contradicting the README.
Update all four committed dart_hooks.yaml files to the class-name keys
the code reads and the README documents.
Also improve the diagnostic: when the expected key is missing, the log
now lists the keys that were found and suggests the correct one, so a
typo'd or legacy key no longer disables a hook with an opaque message.
* Update tool/dart_hooks/lib/src/base_hook.dart
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Remove redundant cast that failed dart analyze --fatal-infos
yaml is already promoted to Map by the enclosing `if (yaml is Map)`, so
`(yaml as Map)` is an unnecessary_cast that `dart analyze --fatal-infos`
treats as fatal. Drop the cast.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Support YAML configuration for format and analyze hooks
* Configure format and analyze hooks via YAML and address code review findings
* Update README with YAML configuration details
* Refactor BaseHook readFile to use asynchronous FutureOr and restore Git/Status exit codes to 0
* Normalize hardcoded test paths for Windows compatibility
* Fix Windows compatibility for agent_dart_analyze_integration_test.dart endsWith checks
* Normalize paths returned by getModifiedFilesInternal to fix mixed separators on Windows
* feat(hooks): configure analyze and format hooks via YAML config keys
* doc(hooks): bump version to 0.0.2 and update README and CHANGELOG
* doc(hooks): highlight yaml configuration requirement in CHANGELOG
* doc(hooks): correct version to 0.1.0 for breaking change
* doc(hooks): add debugging activation guide to README
* doc(hooks): remove tense words (now) from CHANGELOG
* doc(hooks): refine YAML configuration key description in CHANGELOG
* 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