Skip to content

Make the tree clang-format clean and gate it in CI - #61

Merged
chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/make-the-tree-clang-format-clean-and-gate-it-in-ci
Sep 15, 2026
Merged

chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/make-the-tree-clang-format-clean-and-gate-it-in-ci

Conversation

@chrisuthe

Copy link
Copy Markdown
Member
  • Regroup includes so quoted local headers stay in their own block, apart from <sys/...>, <spa/...> and <gtest/...>. Also treat control.h as the main header of control_*.cpp and mdns.h as the main header of mdns_*.cpp. The .clang-format header now says it follows sendspin-cpp's config except for include grouping.
  • Reformat every tracked *.cpp/*.h with clang-format 20.1.8, in its own commit. Only whitespace, line breaks and include order change. Tables take the reflow, with no clang-format off guards.
  • Add scripts/format.sh: it formats in place by default, --check fails on any violation, and CLANG_FORMAT overrides the binary.
  • Add a clang-format CI job that installs clang-format 20.1.8 with pipx and runs scripts/format.sh --check.
  • Mention scripts/format.sh in contributors.md.

Tested locally with a -DSENDSPIN_CLI_WERROR=ON build and ctest. ParseOptions.ARelativeControlSocketIsMadeAbsoluteUnderZ and ConfigMerge.AConfiguredControlSocketIsAbsolutizedUnderDaemonize fail only when the working directory path is long enough to push the absolute socket path past the Unix socket limit. Both pass from a short directory.

@chrisuthe
chrisuthe marked this pull request as ready for review September 15, 2026 22:31
@chrisuthe
chrisuthe merged commit 0c58c2d into main Sep 15, 2026
16 checks passed
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