Commit 2d09b5b
committed
diagnostics: Fix specificity calculation for message-based matches
Fixed a bug in `calculate_match_specificity` where the priority bonus
for message-based pattern matches was computed but not returned.
The function was executing `specificity + 2` instead of
`specificity += 2`, resulting in message-based matches having the same
priority as code-based matches.
This caused the diagnostic configuration system to incorrectly handle
cases where both code-based and message-based patterns matched the same
diagnostic. Message-based patterns should have higher priority
(specificity +2) to allow more fine-grained control.
Added a test case to verify that message-based literal matches
(specificity=4) are correctly prioritized over code-based regex matches
(specificity=1).1 parent 0a65a5a commit 2d09b5b
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
565 | 591 | | |
566 | 592 | | |
567 | 593 | | |
| |||
0 commit comments