Skip to content

feat: baseline support for incremental adoption - #42

Closed
gabrielbmoro wants to merge 1 commit into
mainfrom
feature/baseline-support
Closed

gabrielbmoro wants to merge 1 commit into
mainfrom
feature/baseline-support

Conversation

@gabrielbmoro

Copy link
Copy Markdown
Collaborator

Summary

Adds baseline support so a developer can adopt EagleEye step by step on a
codebase that already has architecture violations.

A baseline records the violations that exist today. Future runs suppress the
known violations and fail only on new ones — letting a team freeze legacy
debt and block regressions from day one.

How it works

State dart run eagle_eye:main dart run eagle_eye:main --baseline
No baseline file all violations fail (unchanged) writes baseline, exit 0
Baseline exists, no new violations success + suppressed count, exit 0 overwrites baseline, exit 0
Baseline exists, new violations prints new violations only, exit 1 overwrites baseline, exit 0
Baseline exists, stale entries warns and keeps entries prunes on write
Malformed baseline prints error, exit 1 prints error, exit 1
  • --baseline is aliased by --update-baseline.
  • Baseline file: eagle_eye_baseline.json at the project root (committed).
  • Identity: filePath + ruleType + importUri — line/column independent, so
    shifting code around does not resurface known violations.

Changes by layer

  • lib/model/: baseline_entry.dart, eagle_eye_baseline.dart,
    exceptions/invalid_baseline_exception.dart
  • lib/analyzer/: baseline_filter.dart (BaselineFilter / BaselineResult)
  • lib/data/: read/write + JSON via FileHelper, JsonConverter,
    EagleEyeRepository
  • lib/eagle_eye_launcher.dart: launchEagleEye({bool updateBaseline})
  • bin/main.dart: parses --baseline / --update-baseline
  • lib/util/logger_helper.dart: added printInfo
  • Docs: README.md, doc/1-getting-started.md, SETUP_PROMPT.md,
    CHANGELOG.md; version bumped to 2.1.0

Tests

New unit tests (model + analyzer):
test/model/baseline_entry_test.dart,
test/model/eagle_eye_baseline_test.dart,
test/analyzer/baseline_filter_test.dart.

Also verified end-to-end in a throwaway project: generate → suppress →
new-only failure → stale warning → prune → malformed handling.

dart analyze   # No issues found!
dart test      # 38 tests passed

@gabrielbmoro
gabrielbmoro deleted the feature/baseline-support branch October 10, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant