-
-
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
Deprecate recursive mode #240
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Closed
infinisil
force-pushed
the
deprecate-passing-directories
branch
3 times, most recently
from
August 26, 2024 23:54
d3df458
to
423417a
Compare
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)
infinisil
force-pushed
the
deprecate-passing-directories
branch
from
August 27, 2024 19:29
423417a
to
ba0c3fa
Compare
This wasn't implemented anymore, and we've also decided to focus on using treefmt instead, which supports parallel formatting
While already touching this code, I cleaned up some unneeded code that was needed for parallelism in the past. That's not implemented anymore though, and treefmt can be used for parallelism instead. |
Closed
0x4A6F
approved these changes
Sep 3, 2024
piegamesde
approved these changes
Sep 3, 2024
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-09-03/51584/1 |
infinisil
added a commit
to tweag/nixpkgs
that referenced
this pull request
Nov 28, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
1 task
dasJ
pushed a commit
to NixOS/nixpkgs
that referenced
this pull request
Nov 28, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
github-actions bot
pushed a commit
to NixOS/nixpkgs
that referenced
this pull request
Nov 28, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/) (cherry picked from commit edd47f7)
mkg20001
pushed a commit
to mkg20001/nixpkgs
that referenced
this pull request
Nov 30, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
mkg20001
pushed a commit
to mkg20001/nixpkgs
that referenced
this pull request
Dec 2, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
mkg20001
pushed a commit
to mkg20001/nixpkgs
that referenced
this pull request
Dec 4, 2024
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. Sonixfmt
will only be the "backend" formatter, whiletreefmt
is the frontend.Previously discussed in a team meeting here:
#151 (comment)