Rip off the bandaid: Format the codebase with clang-format (backport #13108)#13504
Merged
Mic92 merged 6 commits into2.30-maintenancefrom Jul 18, 2025
Merged
Conversation
Contributor
Author
|
Cherry-pick of e4f62e4 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
* It is tough to contribute to a project that doesn't use a formatter, * It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files * Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose, Let's rip the bandaid off? Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge. Co-authored-by: Graham Christensen <graham@grahamc.com>
Co-authored-by: Graham Christensen <graham@grahamc.com>
c36c339 to
03b47a1
Compare
This file contains hidden or 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
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.
I accidentally deleted the branch from the original PR. A brief summary:
Directional +'s from @roberth and @Ericson2314. Some discussion about updating the formatting one way or another around bracing, which was conceded by @roberth in interest of moving forward. This was brought up again re Lix's format changes, but no resolution came from that.
Eelco had concerns and @Mic92 provided what seemed like positive support and answers. Those concerns (and answers) were what about existing PRs (nixpkgs has tools to help), should it backport (probably), and if the git history becomes useless (
.git-blame-ignore-revs, already done in this PR solves it.)Anything I can do to help move this forward?
original PR body and the regeneration script follows
Motivation
Let's rip the bandaid off?
Note that PRs currently in flight should be able to be merged relatively easily by applying
clang-formatto their tip prior to merge.I would also expect it to be not too hard to apply patch backports if the backport targets are similarly formatted with clang-format.
Context
Implementation strategy requires a bit of effort on each branch in active maintenance:
Once that is done, backports should be easy to apply.
Maintainers can focus on only the change in the first commit, and optionally completely regenerate the second commit to ensure it wasn't tampered with.
This has been done somewhat: new files must be formatted. However, that makes it challenging to contribute with editor integration for code formatting.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
Regeneration script below...
This is an automatic backport of pull request #13108 done by [Mergify](https://mergify.com).