Expand description
Utilities to handle linters output Linter parsing helpers.
- Provides an extensible registry of linter parser functions (see
dict). - Currently ships a hardened
sqruffparser exposed under thesqrufftable. - Parses tool JSON output into Nvim diagnostic dictionaries.
- Designed so additional linters can be added with minimal boilerplate.
ยงRationale
- Introduced after the upstream
nvim-lintdefaultsqruffparser failed to handlevim.NIL, crashing the Nvim instance. This implementation treats absence /nilvalues defensively and never propagates a panic. - Centralizing parsers allows consistent error reporting & future sharing of common normalization logic (e.g. severity mapping, range sanitation).
Structsยง
- Position ๐
- Line/column pair (1-based as emitted by
sqruff). - Range ๐
- Source span covering the offending text range.
- Sqruff
Message ๐ - Single
sqrufflint message entry. - Sqruff
Output ๐ - Parsed
sqrufftop-level output structure.
Functionsยง
- diagnostic_
dict_ ๐from_ msg - Convert a single
SqruffMessageinto an Nvim [Dictionary]. - dict
- [
Dictionary] of linters parsers. - parser ๐
- Parse raw
sqruffJSON output into Nvim diagnostic [Dictionary].