Skip to content

Commit

Permalink
fix: silence the #-command linter on noisy commands (#20525)
Browse files Browse the repository at this point in the history
  • Loading branch information
adomani committed Jan 6, 2025
1 parent 89f60e1 commit aa37b81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Tactic/Linter/HashCommandLinter.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ logs a warning only for the `#`-commands that do not already emit a message. -/
def hashCommandLinter : Linter where run := withSetOptionIn' fun stx => do
let mod := (← getMainModule).components
if Linter.getLinterValue linter.hashCommand (← getOptions) &&
((← get).messages.toList.isEmpty || warningAsError.get (← getOptions)) &&
((← get).messages.reportedPlusUnreported.isEmpty || warningAsError.get (← getOptions)) &&
-- we check that the module is either not in `test` or, is `test.HashCommandLinter`
(mod.getD 0 default != `test || (mod == [`test, `HashCommandLinter]))
then
Expand Down
6 changes: 0 additions & 6 deletions MathlibTest/HashCommandLinter.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import Lean.Elab.GuardMsgs
import Mathlib.Tactic.AdaptationNote
import Mathlib.Tactic.Linter.HashCommandLinter


-- #adaptation_note
-- The hashCommand linter started failing after https://github.com/leanprover/lean4/pull/6299
-- Disabling aync elaboration fixes it, but of course we're not going to do that globally.
set_option Elab.async false

set_option linter.hashCommand true

section ignored_commands
Expand Down

0 comments on commit aa37b81

Please sign in to comment.