fix: make the omit, unusedSectionVars and loopingSimpArgs linter respect linter.all#12563
Conversation
fiforeach
left a comment
There was a problem hiding this comment.
The suggested changes should make the code compile.
However, I would also suggest you add some test cases.
|
Please undraft once ready for review |
|
(CI fails because of a missing changelog label: I cannot add this myself, I believe.) |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
|
I see Linux Lake failing |
The test Adding the line set_option linter.unusedSectionVars trueto the top (say after the first line) of Footnotes |
|
@grunweg Are you planning on pursuing this further? Since I want to have this feature, I would be happy to continue with this PR. |
|
I'd like to get this landed, but I won't have time for it this week. You're very welcome to adopt this PR; I'll be happy to look over your changes if you'd like me to. Thanks for the offer! |
|
I took the liberty to draft this PR. Please undraft when you two are happy with it |
9cb78a4 to
a93658d
Compare
…ect linter.all Similarly to leanprover#12559, these linters should honour the linter.all flag being set to false. These are all remaining occurrences of this pattern. Co-authored-by: fiforeach <249703130+fiforeach@users.noreply.github.com>
9f19854 to
4f578c1
Compare
|
@fiforeach I have squashed all commits into one. Let me know if there is a better way to attribute your co-authorship! |
|
I am happy with this PR now (assuming it passes). @fiforeach What about you? |
|
@grunweg All good from my side. Thanks for asking! |
|
We are both happy with this PR! |
|
Were the performance changes when compiling |
|
I didn't expect these, but they don't terribly surprise me either: checking if the linter is enabled now has to do slightly more work, so it's fairly plausible there is an impact. I am a bit surprised by the size of the effect, though. |
|
Maybe some caching will be needed here at some point |
|
The issue is that some files enable all linters Previously, the linters The "fix" would be never to use |
|
Ok, whoever enables all linters deserves a slow down :-) |
This PR makes the
omit,unusedSectionVarsandloopingSimpArgslinters respect thelinter.alloption:when
linter.allis set to false (and the respective linter option is unset), the linter should not report errors.Similarly to #12559, these linters should honour the linter.all flag being set to false. These are all remaining occurrences of this pattern.
This fixes an issue analogous to #12559.
This PR and #12560 fix all occurrences of this pattern. (The only question is around
RCases.linter.unusedRCasesPattern: should this also respect this? I have left this alone for now.)