oppiliappan / statix

lints and suggestions for the nix programming language
https://git.peppe.rs/languages/statix/about
MIT License
557 stars 21 forks source link

Feature Request: stdin Support #16

Closed cyntheticfox closed 2 years ago

cyntheticfox commented 2 years ago

A lot of linting engines are designed to run with stdin so as to allow for checking buffers instead of only saved files. I've seen this done either as the default, or with a specific --stdin flag. Support for both check and fix would be great.

Specifically requesting this since it might be necessary for #10.

oppiliappan commented 2 years ago

I've seen this done either as the default, or with a specific --stdin flag.

Understood. I did feel like a "streaming" option for all interactions was long overdue. I'll work on this over the weekend.

oppiliappan commented 2 years ago

The latest release (v0.4.0) contains a -s, --stdin flag for statix check, statix fix and statix single. Every subcommand with the flag will accept exactly one file on stdin and output diagnostics on stdout.

The other flags will function as expected, for example, statix check -o errfmt -s will accept a file on stdin and output errorformat compatible output on stdout.

Feel free to reopen if something is not functioning as expected :)