bug: RulesEngine.check breaks after first matching rule per file
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start in src/diff_contract/engine.py at RulesEngine.check and inspect the existing test suite for rule matching. Add coverage for a file matching three rules, then run the existing tests and confirm that all three violations are reported while current behavior remains intact.
Written by the indexing model from the issue text.
Description
Context
In RulesEngine.check in src/diff_contract/engine.py, the inner loop has break after the first matching rule for a file.
Problem
If a file matches multiple rules (e.g., both a deny rule and an allow rule), only the first violation is reported. The user sees an incomplete picture of all contract violations, which could mask additional issues.
Impact
- Incomplete violation reporting: users miss multiple contract breaches per file
- Security risk: a second denied change goes unreported
- Debugging difficulty: must re-run after fixing first violation to discover others
Suggested Fix
Remove the break to collect all violations per file, or add a configuration option to control this behavior.
Acceptance Criteria
- A file matching 3 rules produces 3 violations (not 1)
- Existing tests pass
- New tests cover multi-rule matching
- Dominant language
- Python
- Stars
- 1
- Forks
- 3
- Avg merge
- 8h 23m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yunaremaia/diff-contract
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yunaremaia/diff-contract#70 ·
-
good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
yunaremaia/diff-contract#43 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
yunaremaia/diff-contract#41 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yunaremaia/diff-contract#40 ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yunaremaia/diff-contract#30 ·
All issues in yunaremaia/diff-contract
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100