Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter エラーが設定を貫通する #1247

Closed
Seasawher opened this issue Dec 28, 2024 · 2 comments · Fixed by #1255
Closed

linter エラーが設定を貫通する #1247

Seasawher opened this issue Dec 28, 2024 · 2 comments · Fixed by #1255
Assignees

Comments

@Seasawher
Copy link
Member

ring のところに tactic does nothing という warning が出て、これをどうやっても消すことができない。

/-- `#expand` の入力に渡すための構文カテゴリ -/
syntax macro_stx := command <|> tactic <|> term

open Lean in

/-- マクロを展開するコマンド -/
elab "#expand " t:macro_stx : command => do
  let t : Syntax := match t.raw with
  | .node _ _ #[t] => t
  | _ => t.raw
  match ← Elab.liftMacroM <| Macro.expandMacro? t with
  | none => logInfo m!"Not a macro"
  | some t => logInfo m!"{t}"

set_option linter.unreachableTactic false

/--
info: first
| ring1
| try_this ring_nf
-/
#guard_msgs (info) in
  #expand ring
@Seasawher
Copy link
Member Author

最小化した例

import Mathlib.Tactic

open Lean in

elab "#greet " _t:tactic : command => do
  logInfo "hello"

set_option linter.unreachableTactic false

/-- info: hello -/
#guard_msgs (info) in
  #greet simp

@Seasawher
Copy link
Member Author

drop warning を追加すればいいだけだった

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant