A linter for long commands #
The linter.longDeclaration linter warns when a command contains more than 200 lines of code
(excluding comments). The bound is configurable with linter.longDeclaration.maxLines.
There is a general consensus that long proofs are bad style, and are better refactored into multiple smaller lemmas (making proofs easier to understand for human readers, faster to compile, and more likely to be re-usable elsewhere).
Blank lines and lines consisting entirely of comments are excluded (in order to avoid incentivizing authors not to comment their code). Multiline tokens, such as string literals, contribute all their lines, including blank lines within them. Only original source ranges are checked, and commands with errors are skipped.
The linter inspects the source syntax of every command. For declarations, the entire written
statement and body count, including explicit hypotheses, attached where definitions and
termination hints. Hypotheses introduced by separate variable commands do not contribute to
subsequent declarations (but the variable command itself may raise a warning if it is over the
length limit). Mutual blocks and custom commands are checked in the same way.
Enable warnings for commands exceeding the code-line limit.
Maximum number of lines of code allowed in a command.