lean4-htt/tests/misc_dir/plugin/SnakeLinter.lean
Garmelon a3cb39eac9
chore: migrate more tests to new test suite (#12809)
This PR migrates most remaining tests to the new test suite. It also
completes the migration of directories like `tests/lean/run`, meaning
that PRs trying to add tests to those old directories will now fail.
2026-03-06 16:52:01 +00:00

18 lines
560 B
Text

import Lean
open Lean
def oh_no : Nat := 0
def snakeLinter : Linter where
run stx := do
if stx.getKind == ``Lean.Parser.Command.declaration then
let decl := stx[1]
if decl.getKind == ``Lean.Parser.Command.definition then
let declId := decl[1]
withRef declId do
let declName := declId[0].getId
if declName.eraseMacroScopes.toString.contains '_' then
-- TODO(Sebastian): return actual message with position from syntax tree
throwError "SNAKES!!"
initialize addLinter snakeLinter