Open Mic92 opened 1 year ago
I think if users pass files than statix actually does not have to check the gitignore at all since the user already made a choice what to format.
What do you think of this behavior:
statix PATH
: statix will apply its usual ignoring and traversal operations, users running statix manually would prefer this behaviorstatix [PATHS ...]
: statix will run on every path supplied regardless of ignore options (either from .gitignore
or statix.toml
), directories will NOT be traversed in this scenario, the caller has to use a glob like statix DIR/**/*.nix
. this behavior might be preferred by tools.Just an idea though, open to suggestions here.
What if it only applies gitignore if $PATH is a directory? Otherwise treefmt
with one file change will behave differently compared two multiple. Treefmt has an internal cache to apply formatter only to changed files.
yeah, that sounds reasonable to me.
@nerdypepper thanks for maintaining and opensourcing such a great tool!
I want to properly integrate statix
with treefmt
(see issue), but I found that the best solution would be to report this upstream. As mentioned before by @Mic92 , treefmt
needs the formatters to accept multiple file paths after statix fix
.
Is there any update on this? I am also willing to help, if I can.
sorry about the inactivity here, @kaikikokuke, i am going to take a good chunk out of this weekend to revisit all of statix in general, i'll try to get some time to do this there.
No worries @nerdypepper. Thanks for the reply and taking your time to improve statix
. If there are any good first issues or enhancements, just label them or let me know
I use treefmt for formatting large code bases and incorporating multiple linters into one tool. Treefmt requires that formatters/linters accept multiple arguments. statix does not support this and hence workarounds are required to make it work: https://github.com/Mic92/dotfiles/commit/1b4d901a9e88de101862f3009c3b9e635820f2b3
In https://github.com/nerdypepper/statix/pull/62 I made an attempt to implement this.