New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have --check
output be in different formats (pretty/unified/json)
#230
Comments
You can pass code into For |
Awesome, this satisfies 99% of my use case, but it still seems like it'd be worth it to have an option to explicitly pass the output to
Its effectively the same thing; I know the path so I'm either just outputting the file or passing it to
Yes, exactly. I'm not familiar with it enough to decoratively say whether or not:
is something that is easily done, but I cannot imagine it hurts either way. Depends on how easy it is to do and the complexity that it adds to So TLDR, either of the things you mentioned would be nice, but given it is possible to dump a file to Feel free to close this if you want, or leave it open to track any changes you see fit. |
I think I'll leave the formatting dumped to stdout when taking in a path for now, since it can be done externally with Having |
--check
output be in different formats (pretty/unified/json)
This is now supported in v0.13.0: https://github.com/JohnnyMorganz/StyLua/releases/tag/v0.13.0 |
In summary, add an argument to dump the formatted file to
STDOUT
rather than doing things in-place, say,--stdout/-d
mode.An alternative that I've used with a number of different tools is to pass diff output to
patch
in order to reconstruct what the changed file would look like. Forstylua
, something likestylua --check /path/to/file.lua | patch -p0 -s -o -
. However, the--check
option does not output a patch-able format (to my knowledge) so doing something like this doesn't give the "final" output either.Given the former option of adding a new argument or similar, discerning which
STDOUT
applies to which file can be difficult as well, so it seems absolutely viable to havestylua
only accept a single file when being run in either of these modes.Thoughts @JohnnyMorganz?
The text was updated successfully, but these errors were encountered: