Skip to content

Commit 0bdfb3e

Browse files
Add readme on clang tools
1 parent 8747546 commit 0bdfb3e

1 file changed

Lines changed: 37 additions & 4 deletions

File tree

README.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,48 @@ In some cases, you may need to perform a full clean that deletes all build artif
480480
./build.sh clean-all
481481
```
482482

483-
### Clang format
484-
CPP SDK is using clang C++ format
483+
## Quality Checks
484+
485+
This SDK leverages various tools and checks to ensure the highest quality of the code.
486+
487+
### Clang Tools
488+
489+
- `clang-tidy`: static analysis checks to catch common C++ pitfalls. See [.clang-tidy](./.clang-tidy) for the list of current checks (enforced in CI on PR)
490+
- `clang-format`: (coming soon) code formatting and style consistency
491+
492+
> **Note**: clang-tidy is not currently supported on Windows for this project because the Visual Studio CMake generator does not produce the compile_commands.json database that clang-tidy requires.
493+
494+
To run locally, first install the following:
495+
496+
**macOS:**
497+
485498
```bash
486-
brew install clang-format
499+
# macOS
500+
brew install llvm
487501
```
488502

503+
This installs `clang-format`, `clang-tidy`, and `run-clang-tidy`. Homebrew may ask you to add `/opt/homebrew/opt/llvm/bin` to your `PATH`.
504+
505+
**Linux:**
506+
507+
```bash
508+
# Ubuntu / Debian:
509+
sudo apt-get install clang-format clang-tidy clang-tools
510+
```
511+
512+
To run:
513+
514+
1. Run a build script command, such that `compile_command.json` is present at the root of the repository
515+
2. Run:
516+
517+
```bash
518+
clang-tidy -p . src/*.cpp
519+
```
520+
521+
### Memory Checks
489522

490-
#### Memory Checks
491523
Run valgrind on various examples or tests to check for memory leaks and other issues.
524+
492525
```bash
493526
valgrind --leak-check=full ./build-debug/bin/livekit_integration_tests
494527
valgrind --leak-check=full ./build-debug/bin/livekit_stress_tests

0 commit comments

Comments
 (0)