Repository navigation
chore: Exclude vendored and generated code from clang-format - #630
Merged
Merged
Conversation
Add a root .clang-format-ignore for src/vendor/** and the cpp11-generated src/cpp11.cpp, and keep it out of the built package. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3zHUSUZLRSv2YuHbe
Member
Author
Accepted limitationsNone. The clean review found nothing above Low; its Low notes (repository-root-relative patterns, and that CI's top-level glob never reaches Generated by Claude Code |
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.
.clang-formatalready exists and every top-levelsrc/C/C++ file already conforms to it, so this PR is configuration only: it adds a root.clang-format-ignoreand lists it in.Rbuildignore(which already lists.clang-format). The CI style action runs clang-format oversrc/*.{c,cc,cpp,h,hpp}whenever.clang-formatexists, so generated code has to be excluded explicitly. The planned formatting commit is empty and therefore skipped: there is nothing to format.Excluded patterns, in
.clang-format-ignore:src/vendor/**: vendored Boost headers (1406 files), replaced wholesale on upgrade. They do not conform (verified: without the ignore filesrc/vendor/boost/limits.hppis reported), so keeping them out matters if the CI glob ever widens.src/cpp11.cpp: generated bycpp11::cpp_register(). It carries// clang-format off, which already keeps clang-format away today; the ignore file makes the exclusion independent of that marker, which a futurecpp11::cpp_register()might not emit.Repo docs consulted:
.github/CONTRIBUTING.mdand.github/copilot-instructions.md(nothing on formatting or vendoring); noAGENTS.md,CLAUDE.mdorhandbook/. There is no PR template.How byte-identity was checked: no compiled input changed.
git diff --stat origin/main..HEADtouches only.Rbuildignore(+1 line) and.clang-format-ignore(new, 4 lines), so a build comparison is unnecessary and was not done. With clang-format 21.1.8:clang-format --dry-run -Werroroversrc/*.c src/*.cpp src/*.h(the CI file set) exits 0; the same command onsrc/vendor/boost/limits.hppandsrc/cpp11.cppexits 0 with no output (ignored).R CMD build --no-build-vignettesproduces a tarball containing no.clang-format*file (the onlyclangmatches are Boost's ownclang.hppandclang_version.hpp).https://claude.ai/code/session_01Hr1rd3zHUSUZLRSv2YuHbe
Generated by Claude Code