-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Remove recursive mode #151
Comments
"Taking forever" ~> 20 seconds, just to not mislead what I meant by that technical hyperbole (but then again, how many expect a linter/formatter to take more than sub two seconds). |
While Handling gitignore semantics is a highly non-trivial task, and should not be re-implemented for every language formatter. |
@piegamesde I don't agree with this. It's really not that hard to support this, because we can use a library like vcs-ignore, which will be good enough for most cases. |
A especially good argument for needing this is that it doesn't make sense for a formatter to accept directory arguments when it doesn't make any effort to filter those directories, because at that point you need to use another tool for filtering anyways and you'd pass files to the formatter instead. And at that point, Low priority, but let's keep this open for now. |
Yeah, adding directories has just been added in the last release, and honestly I'm uncertain about that either. There's already issues with symlink handling IIRC. |
Btw, vanilla nixfmt behaves the same |
(discussed in the team meeting today)
So let's not worry about implementing this and instead focus on |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-03-19/41845/1 |
Because of just calling nix fmt does not ignore .direnv NixOS/nixfmt#151
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-08-06/50222/1 |
The recursive mode has caused problems because it doesn't do any filtering, which can mess with files in `.git` directories and elsewhere. While we could support sane implicit filters and an interface to filter explicitly, that adds complexity and maintenance burden. Instead, we can promote the use of `treefmt` instead, a "formatting multiplexer", which supports file filtering by default. So `nixfmt` will only be the "backend" formatter, while `treefmt` is the frontend. Previously discussed in a team meeting here: #151 (comment)
PR to weakly deprecate recursive mode: #240 |
The recursive mode has caused problems because it doesn't do any filtering, which can mess with files in `.git` directories and elsewhere. While we could support sane implicit filters and an interface to filter explicitly, that adds complexity and maintenance burden. Instead, we can promote the use of `treefmt` instead, a "formatting multiplexer", which supports file filtering by default. So `nixfmt` will only be the "backend" formatter, while `treefmt` is the frontend. Previously discussed in a team meeting here: #151 (comment)
The recursive mode has caused problems because it doesn't do any filtering, which can mess with files in `.git` directories and elsewhere. While we could support sane implicit filters and an interface to filter explicitly, that adds complexity and maintenance burden. Instead, we can promote the use of `treefmt` instead, a "formatting multiplexer", which supports file filtering by default. So `nixfmt` will only be the "backend" formatter, while `treefmt` is the frontend. Previously discussed in a team meeting here: #151 (comment)
The recursive mode has caused problems because it doesn't do any filtering, which can mess with files in `.git` directories and elsewhere. While we could support sane implicit filters and an interface to filter explicitly, that adds complexity and maintenance burden. Instead, we can promote the use of `treefmt` instead, a "formatting multiplexer", which supports file filtering by default. So `nixfmt` will only be the "backend" formatter, while `treefmt` is the frontend. Previously discussed in a team meeting here: #151 (comment)
The recursive mode has caused problems because it doesn't do any filtering, which can mess with files in `.git` directories and elsewhere. While we could support sane implicit filters and an interface to filter explicitly, that adds complexity and maintenance burden. Instead, we can promote the use of `treefmt` instead, a "formatting multiplexer", which supports file filtering by default. So `nixfmt` will only be the "backend" formatter, while `treefmt` is the frontend. Previously discussed in a team meeting here: #151 (comment)
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-12-10-and-2025-01-07/58466/1 |
Context
Currently testing out the new
pkgs.nixfmt-rfc-style
, and it's taking forever + erroring out since it attempts to format my .gitignored.direnv/
folder:Expected behaviour
Things to consider:
.direnv/
,result/
)?The text was updated successfully, but these errors were encountered: