Skip to content

style: add clang-format config and reformat C++ sources#1230

Open
msluszniak wants to merge 1 commit into
mainfrom
@ms/clang-format-config
Open

style: add clang-format config and reformat C++ sources#1230
msluszniak wants to merge 1 commit into
mainfrom
@ms/clang-format-config

Conversation

@msluszniak

Copy link
Copy Markdown
Member

Description

Replaces the implicit default LLVM style (which aggressively wrapped function signatures, chained ternaries and string concatenations) with a custom .clang-format: LLVM base, ColumnLimit: 100, Standard: c++20 and InsertNewlineAtEOF. A .clang-format-ignore excludes the vendored libraries (ada, pfft, runner) and the generated ErrorCodes.h, and is picked up automatically by the existing clang-format pre-commit hook (no lefthook.yml change needed). All first-party C/C++/Objective-C sources are reformatted accordingly — the diff is whitespace-only.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

Whitespace-only change (clang-format never alters tokens). Re-running clang-format over the tree produces no further diff (idempotent), and vendored/generated files are left untouched.

Screenshots

Related issues

Closes #1217

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

This is a large but mechanical diff; in-flight C++ branches should rebase onto it to avoid conflicts.

Replaces the implicit default LLVM style (which aggressively wrapped
function signatures, chained ternaries and string concatenations) with a
custom .clang-format: LLVM base, ColumnLimit 100, Standard c++20 and
InsertNewlineAtEOF. A .clang-format-ignore excludes the vendored
libraries (ada, pfft, runner) and the generated ErrorCodes.h, and is
picked up automatically by the existing clang-format pre-commit hook.

Reformats all first-party C/C++/Objective-C sources accordingly.

Closes #1217
@msluszniak msluszniak self-assigned this Jun 12, 2026
@msluszniak msluszniak added the chore PRs that are chores label Jun 12, 2026

@chmjkb chmjkb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configuration looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore PRs that are chores

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add clang format config file

2 participants