-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Reformat Nixpkgs #322520
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/formatting-team-meeting-2024-05-28/46126/1 |
First step towards this, |
After the above PR, here's the next one with first formatting pass! #322537 🎉 |
Should we include |
Discussed in todays meeting:
I'll implement this together with the upcoming full treewide reformat |
This is only relevant for pushes regarding a change in the definition of the formatter used for CI, right? Wouldn't it be better to just be more diligent to reformat nixpkgs (and/or have CI verify that fact) on the few occasions that the formatter definition is actually changed, without any auto-commit business? |
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 |
No it's for any random PR that introduces a new Nix file. The problem is that nothing forces CI to rerun before the PR can be merged, even if the formatter version has changed on master. So to the merger it looks like CI is green, but if you ran it again it would fail. This would be fixed by merge queues, but that needs some work. This is only a problem with PRs introducing new files, because all existing files will have to be reformatted to pass CI already in the PR that updates the formatter version. |
This could also be solved by a merge-queue, that runs CI on the merge-commit before actually merging. E.g. GitHub's or Mergify's queues. But that's its own can of worms. And as we already saw in NixOS/org#39, it would need to be approached with caution. EDIT: I just realised you'd already said this yourself in the message I was replying to... |
The recent python reformatting has shown that people are eager to have a uniform style already. Even though nixfmt isn't fully stable yet, we can already go ahead and use it to reformat all of Nixpkgs. With future nixfmt changes it can be reformatted again.
shell.nix
/direnv integration: Development shell with a pinned nixfmt #322512Make sure
--verify
succeeds: Use --verify in Nixpkgs diff CI nixfmt#215Change the workflow to only enforce formatting of new/changed files, and do the first formatting pass
Fix [Tracking issue] remove all
src = ./.
entries that unintentionally include their own.nix
files #301014Wait until after the current release, minimise the number of conflicts (by picking a time with minimal open PRs)
[ ] Have better integrationMaketreefmt
,nix fmt
workFix Remove recursive mode nixfmt#151 beforehand[ ] Have an easy maintainer script to rebase PRs with formatting: Script to rebase with formatting nixfmt#159Not a blocker
Open an issue/discourse post with information on the nixfmt reformatting
Format all actively developed branches (master, release-, staging-? (ask staging maintainers)) at the same time to avoid all backporting problems
[ ] Figure out how to do future reformats and nixfmt updates (pin it, probably separately from the main package)Not a blocker
[ ] Make sure there's no problems with generated filesCI will complain when they get updated without being formatted, which gives a good signal to the PR author that they need to either manually format, or implement the formatting in the generator
The text was updated successfully, but these errors were encountered: