Repository navigation
Conversation
…o tooling/incremental-cpp-format
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…-format Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
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.
Stacked on #244 (
tooling/clang-format-config); this diff adds only the incremental command, its tests and instructions.Full-file formatting still reindents existing layouts and introduces unwanted declaration-brace spaces. Add a preview-first command that accepts only same-line whitespace edits on Git-added/modified C++ lines. Keep all leading alignment and newlines, skip reflows/preprocessor/declaration lines, and verify significant Clang raw-token kind/spelling before writing. All candidates are checked before any write; staged content stays untouched and stale snapshots are refused.
Usage from the code worktree:
python3 /path/to/format_changed.py --repo .; add--writeto apply or--checkfor a non-writing check. Default scope is staged + unstaged edits against HEAD;--baseuses the selected parent's merge base for a whole branch. No hooks or source-format gate are enabled. This narrow mode does not fix indentation or replace style lint.Validation: all 35 tests pass locally, using real Uncrustify/Clang and temporary Git repositories for preview/check/write, scope/index preservation, explicit bases, unusual paths, token/literal protection and stale-source rejection. Read-only invocation against the active Arduino checkout also completed without writes. CI builds the pinned tool and passes all 35 tests. Code Health and tabs pass too. No application sources are reformatted or native app builds required.