feat: publish some linter priorities that other linters refer to - #4255
Open
hippietrail wants to merge 4 commits into
Open
feat: publish some linter priorities that other linters refer to#4255hippietrail wants to merge 4 commits into
hippietrail wants to merge 4 commits into
Conversation
- `assert_lint_message` only failed when the message didn't match - not when no message was generated at all - Due to the above, a test in `out_of_the_window` had been failing silently. - Due to the above, a test in `split_words` had been silently failing since a logic update a month ago. - Add a test to make sure that when `SpellCheck` and `WrongNegative` lints are both enabled, `WrongNegative` gets first stab at fixing errors relevant to both.
…lic_linter_priorities
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.
Issues
N/A
Description
We already had a couple of linters that declared their priorities had to be higher or lower than a certain other linter. This was only noted in comments.
While investigating why "unvisible" was flagged by
SpellCheckinstead ofWrongNegative, I wanted to do this again. So instead I've made doing this a bit more robust by publishing the priorities of two linters and the other linters can bump those up or down in logic rather than just in comments.One closely related problem is that lower priority numbers mean higher priority. So one of the existing ones may have had this backward. I kept its logic as it was but added a comment stating this possibility.
Update: I added a test to make sure
WrongNegativegets a shot at linting an error beforeSpellCheck. In doing so I discovered thatassert_lint_messageonly failed if there was a lint message but it didn't match. I now also fails if there's no lint message at all. This revealed that two long-standing tests have been silently failing:ves_the_right_message_for_canadian_englishinout_of_the_window.rsandnot_confident_proc_should_be_pro_cinsplit_words.I removed the one from
split_wordswhich tested that "proc" got corrected to "pro c" since splits resulting in single letters was specifically removed in #3857 - so I moved "proc" to that test.The one in
out_of_the_windowhad silently been backwards and is now correct.One gotcha was that to test multiple linters on the same mistake, you have to manually call
remove_overlaps(), which was not obvious to me.How Has This Been Tested?
cargo testAI Disclosure
If Your PR Implements or Enhances a Linter
Checklist