Skip to content

Use Uncrustify for compact C++ formatting and validate against main - #244

Draft
dayfine wants to merge 13 commits into
mainfrom
tooling/clang-format-config
Draft

dayfine wants to merge 13 commits into
mainfrom
tooling/clang-format-config

Conversation

@dayfine

@dayfine dayfine commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Based on fork main; standalone tooling draft with no C++ source reformatting.

Use Uncrustify 0.83.0 for the repository's compact control/namespace braces and }else{. Preserve short getters, empty constructors, spacing within aligned overloads, parameter packs, argument/closing-parenthesis layouts, lambdas and catch chains. Keep includes, comments, LF/CRLF and nested-template spelling unchanged. CI builds a checksum-pinned formatter release and runs 21 configuration tests; it does not enforce source-wide formatting.

The initial main trial changed 2,839 files / 103,323 lines. Preservation tuning reduces this to 2,202 files / 52,592 lines (49.1% less line churn), against the same immutable main 2a692970b6ac4480f2af405d0adc964192df04e0. All 3,169 visited files format without diagnostics and are stable on a second pass; includes and line endings are preserved. Clang raw-token kind/spelling matches for all 2,202 changed files. This is not a full app compilation.

Known limits remain explicit: Uncrustify normalizes leading spaces in const/non-const declaration tables, and inherited class braces may gain a space. The README explains explicit protected regions and tests demonstrate both gaps. No application opt-out comments are added. The bulk preview is not recommended for automatic application or included in this PR.

Full audit and before/after details. Formatter CI: all 21 tests pass; Code Health and tabs pass too.

Residual-diff review distinguishes genuine cleanup from formatter churn: 3,029 matched line pairs are trailing whitespace only and 191 are missing control-keyword spaces; 2,236 add unwanted declaration-brace spaces. Another 11,164 indentation/alignment pairs are mixed and cannot all be called defects. These are matched-pair counts, not total diff lines or an exact good/bad percentage.

For initial adoption use stacked #245: preview-first, Git-edited-line whitespace formatting that preserves all leading columns/newlines and skips reflows, preprocessor and declaration lines. No bulk formatting or automatic hook is enabled. Classification and incremental validation.

@dayfine dayfine changed the title Propose clang-format configuration and document compact-brace limitation Use Uncrustify for compact C++ formatting and validate against main Nov 7, 2026
dayfine and others added 10 commits November 6, 2026 23:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
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