Commit Graph

8 Commits

Author SHA1 Message Date
Jeffrey Lau a81512cfd2
Fix unhandled nix versions for linter 'nix' (#4045)
Previously, it would not generate any lint messages for nix 2.5.

Moreover, it would cause this error whenever the nix command is
invoked, when paired with a custom `g:ale_command_wrapper`:

    Error detected while processing function <SNR>92_NeoVimCallback[29]..<lambda>27[
    1]..<SNR>90_ExitCallback[28]..ale_linters#nix#nix#Command:
    line    1:
    E684: list index out of range: 0
2022-02-02 10:54:07 +09:00
David Houston a9d7f45924
Implement statix Linter and Fixer (#3969)
* Add Statix for Linting

Add `statix check` as a linter. Provides a simple set of definition
tests additionally. Variable names specify "check" to allow for later
addition of `statix fix` as a formatter once stream support is added.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fixup Supported Tools List

I didn't realise there were two separate lists of tools, so add statix
to the other list. Also, remembered "S" comes after "R", and so
re-ordered it.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix statix Test File

I refactored the variables for statix to allow for writing a fixer
later, and forgot to update them in the test, so update them now. Also
remove a stray "i", add missing space before checks

Signed-off-by: David Houston <houstdav000@gmail.com>

* Update Output Stream for v0.4.0

statix v0.4.0 provides a breaking change of output stream from stderr to
stdout.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add statix fix Fixer

Implement statix fix as a fixer for simple Nix antipatterns.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix statix Fixer Tests

Fix the statix fixer tests by removing the unnecessary
'read_temporary_file' value from the command, since it simply uses the
default value.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Add statix Handler Test

Add a test for the statix handler per @hsanson's request.

Signed-off-by: David Houston <houstdav000@gmail.com>

* Fix to run only on stdin for linting

Signed-off-by: David Houston <houstdav000@gmail.com>
2021-11-12 07:34:25 +09:00
Horacio Sanson 3a1728297a
Merge pull request #3227 from Ma27/nixunstable-error-fmt
Update error-parser for `nix-instantiate` on Nix 2.4+
2021-01-25 13:53:09 +09:00
Maximilian Bosch 72dbd7f648
Update error-parser for `nix-instantiate` on Nix 2.4+
In the (unreleased) Nix 2.4 the error-messages have been reformatted[1].
This patch aims to retain proper `.nix`-support in `ale`, for both
stable Nix (2.3 and older) and unstable Nix (2.4 and newer).

[1] https://github.com/NixOS/nix/pull/3590
2021-01-24 22:54:02 +01:00
jD91mZM2 c1b6628425
Add rnix-lsp for Nix diagnostics and completion 2021-01-23 13:23:14 +01:00
w0rp bdad25eefd Add a function for getting matches, and use it to simplify a lot of code 2017-04-18 00:35:53 +01:00
w0rp 706dd050f2 Fix #257 in preparation for #427, standardise options with fallbacks, and make it so every value can be computed dynamically 2017-04-15 13:36:16 +01:00
Alistair Bill be57b545b7 Add support for nix linting 2017-03-05 20:36:29 +00:00