Repository navigation
Fix clang-format refusing to read the repo's config - #627
Merged
Merged
Conversation
A duplicated key makes the whole file unusable, not just that setting. clang-format stops at the second AllowShortFunctionsOnASingleLine and reads no style at all, so anyone following the instruction to format before committing gets an error and commits unformatted instead. * Drop the older `true` spelling and keep `All`, which is the same value, so the effective style is unchanged
goneng
force-pushed
the
fix-clang-format-duplicate-key
branch
from
September 13, 2026 08:42
40c175a to
e1a93f9
Compare
goneng
marked this pull request as ready for review
September 13, 2026 09:52
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.
A duplicated key makes the whole file unusable, not just that setting.
.clang-formatlistsAllowShortFunctionsOnASingleLinetwice, on lines 19 and21, and clang-format rejects the file outright rather than taking the last
value:
So
.github/instructions/objective-c.instructions.mdasks for aclang-formatrun before committing that cannot succeed, and nothing in the build or in
BuildPR.ymlruns the tool, so the breakage never surfaces in a log. Raised by@anandghegde while working on #621.
truespelling and keepAll, which is the same value, sothe effective style is unchanged
Test plan
xcrun clang-format -style=file -dump-configfails with the errorabove. After: it prints a config. (Apple clang-format 17.0.0, the one Xcode
ships, so no install is needed to reproduce.)
19 gives a byte-identical result, since the legacy boolean
truemaps toAll