2020-09-02 18:55:36 +03:00
|
|
|
= Integrate with tools that check files for problems.
|
|
|
|
|
|
|
|
Many file-formats have "lint" tools that check for common problems and point out
|
2020-09-03 08:06:24 +03:00
|
|
|
where they occur. Most of these tools produce output in the traditional message
|
|
|
|
format:
|
2020-09-02 18:55:36 +03:00
|
|
|
|
|
|
|
----
|
|
|
|
{filename}:{line}:{column}: {kind}: {message}
|
|
|
|
----
|
|
|
|
|
|
|
|
If the 'kind' field contains 'error', the message is treated as an error,
|
|
|
|
otherwise it is assumed to be a warning.
|
|
|
|
|
2020-09-03 10:18:19 +03:00
|
|
|
The `:lint-buffer` and `:lint-selections` commands will run the shell command
|
2020-09-04 12:20:50 +03:00
|
|
|
specified in the `lintcmd` option, passing it the path to a temporary file
|
|
|
|
containing the text to be linted. The results are collected in the
|
|
|
|
`*lint-output*` buffer, and analyze it. If `toolsclient` is set, the
|
|
|
|
`*lint-output*` buffer will be displayed in the named client.
|
2020-09-03 10:18:19 +03:00
|
|
|
|
|
|
|
Each reported error or warning causes a marker to appear in the left-hand
|
|
|
|
margin of the buffer that was checked. When the main cursor moves onto that
|
|
|
|
line, the associated messages are displayed. If they get distracting, you can
|
|
|
|
turn off the markers and messages with the `:lint-hide-diagnostics` command.
|
|
|
|
|
|
|
|
You can also use `:lint-next-message` and `:lint-previous-message` to jump
|
|
|
|
between the lines with messages.
|