2020-09-02 17:55:36 +02: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 07:06:24 +02:00
|
|
|
where they occur. Most of these tools produce output in the traditional message
|
|
|
|
format:
|
2020-09-02 17:55:36 +02: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.
|
|
|
|
|
|
|
|
This plugin can run such tools and collect the resulting messages. The complete
|
|
|
|
output is collected in the `*lint-output*` buffer, and any lines in the current
|
|
|
|
file with messages will have a marker displayed next to them in the left margin.
|
|
|
|
When the cursor moves onto a line with the problem, the associated messages will
|
2020-09-03 07:06:24 +02:00
|
|
|
be displayed in a tool tip.
|
2020-09-02 17:55:36 +02:00
|
|
|
|
|
|
|
== Commands
|
|
|
|
|
|
|
|
*lint-buffer*::
|
|
|
|
*alias* lint +
|
|
|
|
Pass the entire buffer through the program named in `lintcmd`. The buffer
|
|
|
|
may contain unsaved changes.
|
|
|
|
|
|
|
|
*lint-selections* [-command <cmd>]::
|
|
|
|
Pass each of the selections through `<cmd>` or, if the `-command` switch is
|
|
|
|
not provided, through the program named in `lintcmd`. The buffer may contain
|
|
|
|
unsaved changes.
|
|
|
|
|
|
|
|
*lint-hide-diagnostics*::
|
|
|
|
Hide line markers and disable the automatic display of messages, if any.
|
|
|
|
|
|
|
|
*lint-next-message*::
|
|
|
|
Jump to the next message generated by the last `lint-buffer` or
|
|
|
|
`lint-selections` command.
|
|
|
|
|
|
|
|
*lint-previous-message*::
|
|
|
|
Jump to the previous message generated by the last `lint-buffer` or
|
|
|
|
`lint-selections` command.
|
|
|
|
|
|
|
|
== Options
|
|
|
|
|
|
|
|
*lintcmd* (str)::
|
|
|
|
The shell command used by lint-buffer and lint-selections.
|
|
|
|
+
|
|
|
|
It will be given the path to a file containing the text to be
|
2020-09-03 07:06:24 +02:00
|
|
|
linted, and must produce output in the format described above.
|
2020-09-02 17:55:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
*toolsclient* (str)::
|
2020-09-03 07:06:24 +02:00
|
|
|
If set, the `:lint` command will try to display its results in the Kakoune
|
|
|
|
client with this name.
|
2020-09-02 17:55:36 +02:00
|
|
|
See <<commands#clients-and-sessions,`:doc commands clients-and-sessions`>>
|
|
|
|
|