Commit 78118d0
committed
refactor: explicit ordered tuple in _classify_patch_error
The previous loop iterated _PatchErrorKind in enum definition order,
making the ordering load-bearing but invisible to future maintainers.
Replace with an explicit _ordered tuple inside the function. The tuple
literal documents that ordering is intentional: more-specific substrings
must precede any shorter ones that are a prefix of them. Adding a new
kind now requires a deliberate insertion at the right position, not just
a new enum member.1 parent 0065ec2 commit 78118d0
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
654 | 658 | | |
655 | 659 | | |
656 | | - | |
657 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
658 | 670 | | |
659 | 671 | | |
660 | 672 | | |
| |||
0 commit comments