Style linters #
This file contains (currently one, eventually more) linters about stylistic aspects: these are only about coding style, but do not affect correctness nor global coherence of mathlib.
Historically, these were ported from the lint-style.py
Python script.
The setOption
linter emits a warning on a set_option
command, term or tactic
which sets a pp
, profiler
or trace
option.
Whether a syntax element is a set_option
command, tactic or term:
Return the name of the option being set, if any.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Whether a given piece of syntax is a set_option
command, tactic or term.
Equations
- Mathlib.Linter.Style.setOption.is_set_option stx = match Mathlib.Linter.Style.setOption.parse_set_option stx with | some _name => true | x => false
Instances For
The setOption
linter: this lints any set_option
command, term or tactic
which sets a pp
, profiler
or trace
option.
Why is this bad? These options are good for debugging, but should not be used in production code. How to fix this? Remove these options: usually, they are not necessary for production code. (Some tests will intentionally use one of these options; in this case, simply allow the linter.)
Equations
- One or more equations did not get rendered due to their size.