Skip to content

Add incremental format and format-check CMake build targets - #247

Draft
dayfine wants to merge 11 commits into
tooling/incremental-cpp-formatfrom
tooling/cmake-incremental-format
Draft

dayfine wants to merge 11 commits into
tooling/incremental-cpp-formatfrom
tooling/cmake-incremental-format

Conversation

@dayfine

@dayfine dayfine commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #245 (tooling/incremental-cpp-format); the diff contains the CMake targets, tests and usage notes.

Add cmake --build <build-dir> --target format and format-check, backed by the edited-line formatter. format applies eligible spacing; format-check previews and fails if eligible changes remain. Both operate on the configured source checkout and use HEAD by default, with PA_FORMAT_BASE for a branch parent.

The targets have no app-build dependency. Python discovery happens at target time, so normal app configuration gains no mandatory formatter/Python dependency. The command uses Uncrustify 0.83.0 plus Clang's token check; clang-format is not required. A Python path can be supplied through PA_FORMAT_PYTHON.

Validation: all 38 local tests pass, including real CMake configure/build invocations with paths containing spaces, missing-Python diagnostics, committed-base selection and proof that the formatting targets do not run an unrelated ALL/app target. Actual SerialPrograms core-only configure and both formatting targets also pass without building the application. The parent workflow now covers these CMake paths and discovers all tests in CI.

Read SerialPrograms/cmake/Formatting.cmake, its target-time adapter, then devtools/format/test_cmake.py. Usage and source-checkout scope are in devtools/format/CMAKE.md.

Formatter/CMake CI passes all 38 tests. Code Health and tabs pass. Actual core-only configure and both real formatting targets also pass; neither target builds the app.

dayfine and others added 11 commits November 6, 2026 23:16
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ental-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant