Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .clang-format

This file was deleted.

1 change: 1 addition & 0 deletions .clang-format
45 changes: 0 additions & 45 deletions .clang-tidy

This file was deleted.

1 change: 1 addition & 0 deletions .clang-tidy
38 changes: 30 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
builds: ${{ steps.filter.outputs.builds }}
tests: ${{ steps.filter.outputs.tests }}
docs: ${{ steps.filter.outputs.docs }}
cpp_checks: ${{ steps.filter.outputs.cpp_checks }}
cpp_tools: ${{ steps.filter.outputs.cpp_tools }}
rust_release_check: ${{ steps.filter.outputs.rust_release_check }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -70,20 +70,23 @@ jobs:
- .github/workflows/ci.yml
- .github/workflows/generate-docs.yml
- .github/workflows/publish-docs.yml
cpp_checks:
cpp_tools:
- src/**
- include/**
- benchmarks/**
- client-sdk-rust/**
- cmake/**
- CMakeLists.txt
- CMakePresets.json
- cpp-tools
- cpp-tools/**
- scripts/clang-format.sh
- scripts/clang-tidy.sh
- scripts/install-pre-commit.sh
- .clang-format
- .clang-tidy
- .gitmodules
- .github/workflows/ci.yml
- .github/workflows/cpp-checks.yml
rust_release_check:
- client-sdk-rust

Expand All @@ -107,11 +110,30 @@ jobs:
name: License Check
uses: ./.github/workflows/license_check.yml

cpp-checks:
name: C++ Checks
cpp-tools:
name: C++ Tools
needs: changes
if: ${{ needs.changes.outputs.cpp_checks == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/cpp-checks.yml
if: ${{ needs.changes.outputs.cpp_tools == 'true' || github.event_name == 'workflow_dispatch' }}
uses: livekit/cpp-tools/.github/workflows/cpp-tools.yml@alan/bootstrap-cpp-tools
with:
clang_format: true
clang_tidy: true
doxygen: true
checkout_submodules: recursive
clang_format_paths: src include benchmarks
clang_tidy_install_rust: true
clang_tidy_setup_command: |
echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
clang_tidy_configure_command: cmake --preset linux-release
clang_tidy_generate_command: cmake --build build-release --target livekit_proto
clang_tidy_build_dir: build-release
clang_tidy_file_regex: '^(?!.*/(_deps|build-[^/]*|client-sdk-rust|cpp-example-collection|vcpkg_installed|docker|docs|data)/).*/src/(?!tests/).*\.(c|cpp|cc|cxx)$'
clang_tidy_header_filter: '.*/(include/livekit|src)/.*\.(h|hpp)$'
clang_tidy_exclude_header_filter: '(.*/src/tests/.*)|(.*/_deps/.*)|(.*/build-[^/]*/.*)'
clang_tidy_require_generated_protobuf: build-release/generated

generate-docs:
name: Generate Docs
Expand Down Expand Up @@ -139,7 +161,7 @@ jobs:
- builds
- tests
- license-check
- cpp-checks
- cpp-tools
- generate-docs
- rust-release-check
if: always()
Expand Down
111 changes: 0 additions & 111 deletions .github/workflows/cpp-checks.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "cpp-example-collection"]
path = cpp-example-collection
url = https://github.com/livekit-examples/cpp-example-collection.git
[submodule "cpp-tools"]
path = cpp-tools
url = https://github.com/livekit/cpp-tools.git
15 changes: 9 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ Be sure to update the directory layout in this file if the directory layout chan
| `src/tests/` | Google Test integration and stress tests |
| `examples/` | In-tree example applications |
| `client-sdk-rust/` | Git submodule holding the Rust core of the SDK|
| `cpp-tools/` | Git submodule holding shared LiveKit C++ clang-format / clang-tidy configs, scripts, and docs |
| `client-sdk-rust/livekit-ffi/protocol/*.proto` | FFI contract (protobuf definitions, read-only reference) |
| `cmake/` | Build helpers (`protobuf.cmake`, `spdlog.cmake`, `LiveKitConfig.cmake.in`) |
| `docker/` | Dockerfile for CI and SDK distribution images |
| `scripts/` | Developer / CI helper scripts (e.g. `clang-tidy.sh`) |
| `scripts/` | Local helper scripts and transition wrappers that delegate shared clang tooling to `cpp-tools/` |
| `docs/` | Documentation root. `docs/` holds hand-written long-form Markdown intended to also read well on GitHub. |
| `docs/doxygen/` | Doxygen tool config, theme assets, and Doxygen-only content (`Doxyfile`, `index.md` mainpage, `customization/*.css`, `customization/header.html`, `customization/favicon.ico`). Files here use Doxygen-only syntax (`@ref`, `@brief`, …) and are not intended for human reading on their own. |
| `.github/workflows/` | GitHub Actions CI workflows |
Expand Down Expand Up @@ -326,11 +327,11 @@ malformed table, missing `@param` on a documented function, …) fails the build

Code should be easy to read and understand. If a sacrifice is made for performance or readability, it should be documented.

Adhere to clang-format checks configured in `.clang-format`. Run `./scripts/clang-format.sh` if needed to confirm code styling, and `./scripts/clang-format.sh --fix` to auto-format generated code created.
Adhere to clang-format checks configured in `.clang-format`, which is a symlink to `cpp-tools/configs/.clang-format`. Run `./cpp-tools/scripts/clang-format.sh --path src --path include --path benchmarks` if needed to confirm code styling. During the transition, `./scripts/clang-format.sh` and `./scripts/clang-format.sh --fix` remain compatibility wrappers.

### Static Analysis

Adhere to clang-tidy checks configured in `.clang-tidy`. Run `./scripts/clang-tidy.sh` if needed to confirm code quality.
Adhere to clang-tidy checks configured in `.clang-tidy`, which is a symlink to `cpp-tools/configs/.clang-tidy`. Run `./scripts/clang-tidy.sh` if needed to confirm code quality; the wrapper supplies this repo's build directory, file regex, and header filters to the shared `cpp-tools` script.

## Dependencies

Expand All @@ -339,6 +340,7 @@ Adhere to clang-tidy checks configured in `.clang-tidy`. Run `./scripts/clang-ti
| protobuf | Private (built-in) | Vendored via FetchContent (Unix) or vcpkg (Windows) |
| spdlog | **Private** | FetchContent or system package; must NOT leak into public API |
| client-sdk-rust | Build-time | Git submodule, built via cargo during CMake build |
| cpp-tools | Developer / CI | Git submodule containing shared LiveKit C++ formatting and static-analysis tooling |
| Google Test | Test only | FetchContent in `src/tests/CMakeLists.txt` |

When adding a new private/vendored dependency to this table, also add a
Expand Down Expand Up @@ -387,8 +389,8 @@ all filtered stages; normal pull requests and pushes use the path filters.
- `.github/workflows/builds.yml` — Reusable SDK and example-collection build
matrix.
- `.github/workflows/tests.yml` — Reusable unit/integration test matrix.
- `.github/workflows/cpp-checks.yml` — Reusable `clang-format` and
`clang-tidy` checks.
- `livekit/cpp-tools/.github/workflows/cpp-tools.yml` — Shared reusable
workflow called directly by `ci.yml` for `clang-format` and `clang-tidy`.
- `.github/workflows/generate-docs.yml` — Reusable Doxygen docs validation.
- `.github/workflows/rust-release-check.yml` — Reusable check that the pinned
`client-sdk-rust` submodule commit maps to a published release. Gated by the
Expand All @@ -407,7 +409,8 @@ When adding or renaming files that affect a CI stage, update the matching
`ci.yml` `changes` filter in the same PR. For example, new build scripts,
CMake files, package manifests, or reusable build workflows should be added to
the `builds` filter; test-only helpers to `tests`; formatting/static-analysis
configuration to `cpp_checks`; and docs generation inputs to `docs`.
configuration (including `cpp-tools` submodule bumps) to `cpp_checks`; and docs
generation inputs to `docs`.

Keep broad agent guidance files such as `AGENTS.md` out of the expensive
`builds`, `tests`, `cpp_checks`, and `docs` filters unless they start affecting
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,13 @@ local `livekit-server --dev`, and run via `ctest` or directly. See

## Developer tools

`clang-tidy`, `clang-format`, `valgrind`, and Doxygen are all wired up via
scripts under `scripts/`. Set up the pre-commit auto-formatter
with:
`clang-tidy` and `clang-format` are provided by the `cpp-tools` submodule, with
transition wrappers kept under `scripts/`. `valgrind` and Doxygen remain
documented with the rest of the local developer tools. Set up the pre-commit
auto-formatter with:

```bash
./scripts/install-pre-commit.sh
./cpp-tools/scripts/install-pre-commit.sh
```

See [docs/tools.md](docs/tools.md).
Expand Down
1 change: 1 addition & 0 deletions cpp-tools
Submodule cpp-tools added at 9f3067
Loading
Loading