Repository navigation
Require braces and enforce clang-format in CI - #660
Merged
Merged
Conversation
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.
Require braces around
ifbodies, including single statements, and enforce the repository's formatting style in CI..clang-formatenablesInsertBracesand disables short single-lineifstatements; the existing Allman brace style remains. Clang-format also applies brace insertion toelsebranches and loops.The
ClangFormatworkflow follows the requested layout:macos-15,actions/checkout@v4, Homebrew clang-format, and a format check on PRs targetingmasterand pushes tomaster.make -f makefile.dev formatandcheck_formatshare one script with per-file diffs and GitHub error annotations. It uses NUL-delimited tracked.cpp/.hpaths, excluding vendoredthird_partycode and untracked build artifacts.Reformat existing maintained sources so the new check starts with a passing baseline. Preserve Windows header ordering through include categories and add explicit braces to the shared platform-specific
staterror path that automatic insertion skips. Documentation covers the local commands and formatter override.Validation:
iffails with the expected file annotation, and the format target inserts braces and repairs the failure.git diff --checkpasses.