Commit 3dd1cd7
committed
Add safe redundant hierarchical relations auto-removal
Implement distinction between safe (auto-fixable) and unsafe (manual review)
redundant hierarchical relations in the lint command.
Safe redundant relations are those with a single unambiguous chain
(A→B→C with redundant direct A→C). These can be safely auto-removed
when using `reqvire lint --fix`.
Unsafe redundant relations occur when multiple paths converge to the
same ancestor (A→B→C and A→D→C with redundant direct A→C). These
require manual review as both paths may have semantic meaning.
Implementation:
- Add SafeRedundantHierarchicalRelations variant to AutoFixableIssue
- Implement path counting logic to distinguish single-chain from multi-path
- Split detect_maybe_redundant_hierarchical_relations into safe/unsafe cases
- Update apply_fixes to handle safe hierarchical relation removal
- Add sorting for deterministic output in lint reports
- Update test suite with comprehensive test cases
Testing:
- Extended test-lint-command with single-chain and multi-path examples
- Verified diff-based test validation for file modifications
- All tests pass successfully
Traceability:
- Satisfies: specifications/SystemRequirements/Requirements.md#safe-redundant-hierarchical-relations-auto-removal
- Verified by: specifications/Verifications/Misc.md#lint-command-verification1 parent 5ad966c commit 3dd1cd7
File tree
28 files changed
+2679
-2160
lines changed- cli/src
- core/src
- specifications
- SystemRequirements
- Verifications
- tests
- test-cli-help-structure
- test-lint-command
- specifications
28 files changed
+2679
-2160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
212 | 224 | | |
213 | 225 | | |
214 | 226 | | |
| |||
431 | 443 | | |
432 | 444 | | |
433 | 445 | | |
| 446 | + | |
434 | 447 | | |
435 | 448 | | |
436 | 449 | | |
| |||
655 | 668 | | |
656 | 669 | | |
657 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
658 | 683 | | |
659 | 684 | | |
660 | 685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
0 commit comments