Skip to content

ci: upgrade clang-format check to v18 (Ubuntu 24.04)#1723

Open
summeroff wants to merge 2 commits into
stagingfrom
ci/clang-format-18
Open

ci: upgrade clang-format check to v18 (Ubuntu 24.04)#1723
summeroff wants to merge 2 commits into
stagingfrom
ci/clang-format-18

Conversation

@summeroff

@summeroff summeroff commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Upgrade obs-studio-node's clang-format CI from clang-format-13 (Ubuntu 22.04) to clang-format-18 (Ubuntu 24.04), and bump the lib-streamlabs-ipc submodule to the merged companion change.

Why

Dev machines build with Visual Studio 2022, which bundles clang-format 19; CI pinned to clang-format-13 caused local-vs-CI formatting drift. clang-format-18 is preinstalled on the ubuntu-24.04 runner (18.1.3), closing most of the gap with no extra install tooling.

Companion to streamlabs/lib-streamlabs-ipc#59 (same upgrade for the IPC submodule) — now merged and pulled in here.

Changes

  • .github/workflows/clang-format.yml: runner ubuntu-22.04 -> ubuntu-24.04; install clang-format-18.
  • ci/check-format.sh: clang-format discovery + version gate 13 -> 18; use command -v instead of type (no stdout noise in CI logs).
  • Reformat controller.cpp, utility.hpp, nodeobs_display.cpp, nodeobs_display.h to satisfy clang-format-18 (stream-chain join, macro reflow, empty-body collapse, cast spacing). No functional changes.
  • Bump lib-streamlabs-ipc submodule 0f7acbb -> dbb7fdd (ci: upgrade clang-format check to v18 (Ubuntu 24.04) lib-streamlabs-ipc#59). This is exactly one commit ahead on the streamlabs line — the merged companion upgrade — and is formatting-only on the IPC side, so osn builds identically.

Notes

  • osn's own format check is gated by git ls-files --modified, which does not flag dirty submodule content, so the submodule bump is not required for this PR's clang-format CI to pass — the IPC tree's formatting is owned by its own CI (Ipc integration #59). The bump is included to keep osn's vendored IPC in lockstep with the merged companion change, not for CI reasons.
  • The submodule's .gitmodules entry still declares branch = master, but master is a stale/legacy branch (49 commits behind) and the pinned commits live on the default streamlabs line. Correcting that stale branch field is out of scope here; flagging as follow-up.

Verification

Formatted all 241 osn source files with clang-format 18.1.3 (the runner's exact build); only the 4 listed files changed and zero residual remained, so check-format.sh / check-changes.sh pass. Submodule bump verified as a single-commit advance (0f7acbb..dbb7fdd = #59 only) via git diff --submodule=log.

Move the clang-format CI from clang-format-13 (Ubuntu 22.04) to
clang-format-18 (Ubuntu 24.04, preinstalled) to match the clang-format
bundled with Visual Studio 2022, the primary build toolchain. Use
command -v instead of type for discovery so a successful lookup no
longer prints to stdout in CI logs.

Reformat controller.cpp, utility.hpp, nodeobs_display.cpp and
nodeobs_display.h to satisfy clang-format-18 (stream-chain join, macro
reflow, empty-body collapse, cast spacing). No functional changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the clang-format CI check to use clang-format 18 on Ubuntu 24.04 to reduce formatting drift between developer environments (VS 2022/clang-format 19) and CI.

Changes:

  • Update the GitHub Actions clang-format workflow to run on ubuntu-24.04 and install clang-format-18.
  • Update ci/check-format.sh to discover/require clang-format 18 and use command -v for quieter detection.
  • Apply clang-format-18-driven reformatting to a small set of C/C++ source/header files (no functional changes intended).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/clang-format.yml Moves the formatting job to Ubuntu 24.04 and installs clang-format-18.
ci/check-format.sh Updates clang-format discovery/version gating to major version 18 and reduces log noise.
obs-studio-client/source/controller.cpp Formatting-only change to command-line stream concatenation.
obs-studio-client/source/utility.hpp Formatting-only reflow of macro bodies to match clang-format 18 output.
obs-studio-server/source/nodeobs_display.cpp Formatting-only: collapses an empty struct definition.
obs-studio-server/source/nodeobs_display.h Formatting-only: adjusts cast spacing in a Win32 macro.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Advance the lib-streamlabs-ipc submodule 0f7acbb -> dbb7fdd, pulling in streamlabs/lib-streamlabs-ipc#59 (the companion clang-format-18 CI upgrade + reformat). Formatting-only on the IPC side; no functional change to osn.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

4 participants