@@ -5,20 +5,14 @@ are also enforced in CI on PRs.
55
66## Clang tools
77
8- ` clang-tidy ` and ` clang-format ` are owned by the
9- [ ` livekit/cpp-tools ` ] ( https://github.com/livekit/cpp-tools ) submodule. The
10- ` ./cpp-tools/install.sh ` script creates root ` .clang-tidy ` and ` .clang-format `
11- symlinks so editor integrations can discover them automatically.
12- The SDK-owned ` .github/workflows/cpp-tools.yml ` workflow prepares the
13- project-specific CI environment and calls the same ` scripts/clang-format.sh `
14- and ` scripts/clang-tidy.sh ` wrappers used locally. The shared scripts detect
15- GitHub Actions automatically and produce annotations and step summaries.
16- Doxygen remains in the SDK-specific documentation workflow.
17-
18- - ** ` clang-tidy ` ** — static analysis. See ` cpp-tools/.clang-tidy ` for the
8+ The shared configuration and tooling scripts come from the
9+ [ ` livekit/cpp-tools ` ] ( https://github.com/livekit/cpp-tools ) submodule.
10+
11+ - ** ` clang-tidy ` ** — static analysis. See
12+ [ cpp-tools/.clang-tidy] ( https://github.com/livekit/cpp-tools/blob/main/.clang-tidy ) for the
1913 enabled checks. Enforced in CI on PR.
2014- ** ` clang-format ` ** — code formatting and style consistency. See
21- ` cpp-tools/.clang-format ` for the rules. Enforced in CI on PR.
15+ [ cpp-tools/.clang-format] ( https://github.com/livekit/cpp-tools/blob/main/.clang-format ) for the rules. Enforced in CI on PR.
2216
2317> ** Note (Windows):** ` clang-tidy ` is not currently driven by our scripts on
2418> Windows. The MSBuild CMake generator doesn't emit
@@ -58,19 +52,20 @@ Install the shared configuration symlinks from the repository root:
5852 ./build.sh release
5953 ```
6054
61- 2 . Run the project wrapper. It supplies the same build directory and filters
62- as CI, then delegates diagnostics and summaries to ` cpp-tools ` :
55+ 2 . Run the wrapper, which uses the same file set, regex filters, and
56+ ` .clang-tidy ` config as CI :
6357
6458 ``` bash
6559 ./scripts/clang-tidy.sh
6660 ```
6761
68- Pass source files positionally to limit analysis, ` -j N ` to override the worker
69- count, ` --fail-on-warning ` for a strict local run, or ` --fix ` to apply fixes:
62+ With no arguments, runs against every relevant file in the repository against
63+ the checks in ` .clang-tidy ` .
7064
7165``` bash
72- ./scripts/clang-tidy.sh src/room.cpp
73- ./scripts/clang-tidy.sh --fail-on-warning
66+ ./scripts/clang-tidy.sh src/ffi_client.cpp # Check just this file
67+ ./scripts/clang-tidy.sh -j 4 # Override worker count
68+ ./scripts/clang-tidy.sh --fix # Apply fixes
7469```
7570
7671Output is captured to ` clang-tidy.log ` at the repo root, since the terminal
@@ -82,10 +77,13 @@ buffer often can't hold all of it.
8277./scripts/clang-format.sh
8378```
8479
80+ With no arguments, runs against every relevant file in the repository against
81+ the rules in ` .clang-format ` .
82+
8583``` bash
86- ./scripts/clang-format.sh --fix
87- ./scripts/clang-format.sh src/room.cpp include/livekit/room.h
88- ./scripts/clang-format.sh --fix src/room.cpp
84+ ./scripts/clang-format.sh --fix # Rewrite files in place
85+ ./scripts/clang-format.sh src/room.cpp include/livekit/room.h # Check just these files
86+ ./scripts/clang-format.sh --fix src/room.cpp # Fix just this file
8987```
9088
9189Output is captured to ` clang-format.log ` at the repo root.
@@ -95,7 +93,7 @@ Output is captured to `clang-format.log` at the repo root.
9593## Pre-commit hook
9694
9795A simple pre-commit hook that auto-formats staged C/C++ files using the
98- project's ` .clang-format ` rules is available as an explicit opt-in :
96+ project's ` .clang-format ` rules:
9997
10098``` bash
10199./cpp-tools/install.sh precommit-hook
0 commit comments