Ignore the because() reason when matching baseline violations#637
Open
fain182 wants to merge 1 commit into
Open
Ignore the because() reason when matching baseline violations#637fain182 wants to merge 1 commit into
fain182 wants to merge 1 commit into
Conversation
…ine violations Rewording a rule's because() text shouldn't make existing baseline entries for self-explanatory violations (no ", but ") look "new" or "fixed" again, since the underlying violation hasn't changed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
=========================================
Coverage 98.25% 98.25%
- Complexity 700 701 +1
=========================================
Files 87 87
Lines 2000 2003 +3
=========================================
+ Hits 1965 1968 +3
Misses 35 35
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improvement
Summary
Changing only the
because()text of a rule has no real meaning for baseline matching: it changes neither the rule nor the violation it explains, so it shouldn't make existing baseline entries look invalidated.Today this happens to work for violations whose message has a
, butpart (e.g. dependency rules), only because everything after, but—because()included — is already dropped from the comparison for an unrelated reason (so that changing the rule's configuration doesn't invalidate the baseline either). For self-explanatory messages (e.g.IsFinal,IsReadonly,HaveNameMatching), there's no, butpart, so the whole message —because()included — is used as-is, and rewording it breaks the match.This PR makes the
because()reason excluded from baseline matching in general, instead of it only working as a side effect for some message formats.