Skip to content

feat: validate configuration before analysis - #47

Merged
gabrielbmoro merged 2 commits into
mainfrom
feature/config-validation
Oct 18, 2026
Merged

gabrielbmoro merged 2 commits into
mainfrom
feature/config-validation

Conversation

@gabrielbmoro

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a pre-analysis validation step for eagle_eye_config.json.
  • New EagleEyeConfigValidator rejects structurally invalid rules and files matched by more than one rule, exiting with code 1 before imports are analyzed.
  • JSON parsing now raises a clear InvalidConfigException for malformed JSON, missing filePattern, wrong types, and invalid patterns instead of failing silently or with a raw TypeError.
  • Updates getting-started docs, setup prompt, README, changelog, and AGENTS.md.

Validation rules

  • filePattern must be a non-empty, valid regex (after * wildcard expansion).
  • Dependency patterns must compile as regexes.
  • A rule may define at most one of dependenciesAllowed: false, forbiddenDependencies, or exclusiveDependencies.
  • Each file in lib/ must match at most one rule. Conflicts are reported with the file and every matching rule.

Tests

  • dart analyze passes.
  • dart test passes (55 tests).
  • Manually verified the CLI exits 1 with a conflict report and exits 0 for a valid config.

@gabrielbmoro
gabrielbmoro merged commit a4f5fdc into main Oct 18, 2026
2 checks passed
@gabrielbmoro
gabrielbmoro deleted the feature/config-validation branch October 18, 2026 00:37
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