Module linters

Module linters 

Source
Expand description

Utilities to handle linters output Linter parsing helpers.

  • Provides an extensible registry of linter parser functions (see dict).
  • Currently ships a hardened sqruff parser exposed under the sqruff table.
  • Parses tool JSON output into Nvim diagnostic dictionaries.
  • Designed so additional linters can be added with minimal boilerplate.

ยงRationale

  • Introduced after the upstream nvim-lint default sqruff parser failed to handle vim.NIL, crashing the Nvim instance. This implementation treats absence / nil values 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.
SqruffMessage ๐Ÿ”’
Single sqruff lint message entry.
SqruffOutput ๐Ÿ”’
Parsed sqruff top-level output structure.

Functionsยง

diagnostic_dict_from_msg ๐Ÿ”’
Convert a single SqruffMessage into an Nvim [Dictionary].
dict
[Dictionary] of linters parsers.
parser ๐Ÿ”’
Parse raw sqruff JSON output into Nvim diagnostic [Dictionary].