-
-
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
Better list argument handling #257
Conversation
1638141
to
ec04379
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-use-nixfmt-for-nixpkgs/56590/2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an extra commit to fix the remaining cases of poor mkRenamedOptionModule
, but with that I think this is looking good!
This fixes the poor formatting of the last remaining cases of mkRenamedOptionModule. We're not removing the line length limit completely because this code path doesn't enforce the line length limit. Co-Authored-By: piegames <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and approved together in today's meeting. This was the final blocker for a treewide Nixpkgs reformat
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-11-26/56643/1 |
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/)
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/)
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)
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/)
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/)
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/)
This kind-of-but-not really supersedes #254. It doesn't explicitly touch on list expansion itself, however the part 2 commit implicitly doesn't force-expand last list arguments anymore by virtue of not absorbing them anymore. List expansion will require a fine-tuning pass after this change, notably the question of whether to never expand the last argument if it's a list (as done in #254), because right now it will only do so if the second-to-last argument also is a list.