Zulip Chat Archive
Stream: lean4
Topic: pretty printing of reverse simp attribute
Aaron Liu (Jan 27 2026 at 19:51):
Surely we want @[simp ←] instead of @[simp← ]?
import Mathlib.Tactic.Linter.Whitespace
set_option linter.style.whitespace true
/--
warning: extra space in the source
This part of the code
'@[simp ←]
theorem'
should be written as
'@[simp← ]
theorem'
Note: This linter can be disabled with `set_option linter.style.whitespace false`
---
warning: missing space in the source
This part of the code
'←]
theorem'
should be written as
'@[simp← ]
theorem'
Note: This linter can be disabled with `set_option linter.style.whitespace false`
-/
#guard_msgs in
@[simp ←]
theorem foo : 0 = id 0 := rfl
mathlib-free:
import Lean
/-- info: @[simp← ] -/
#guard_msgs in
#eval return ← Lean.PrettyPrinter.ppCategory `Lean.Parser.Term.attributes (← `(Lean.Parser.Term.attributes| @[simp ←]))
Kim Morrison (Jan 27 2026 at 22:08):
Issue and/or fix welcome!
Eric Wieser (Jan 28 2026 at 05:26):
Presumably a lot of things like this will naturally be fixed as part of the code formatter work?
Eric Wieser (Jan 28 2026 at 05:27):
(which is not to say we shouldn't fix them as we find them)
Last updated: Feb 28 2026 at 14:05 UTC