|
|
|
@ -262,17 +262,17 @@ of the pybind11 repo.
@@ -262,17 +262,17 @@ of the pybind11 repo.
|
|
|
|
|
more complex to run, compared to `clang-format`, but support for `clang-tidy` |
|
|
|
|
is built into the pybind11 CMake configuration. To run `clang-tidy`, the |
|
|
|
|
following recipe should work. Run the `docker` command from the top-level |
|
|
|
|
directory inside your pybind11 git clone. Files will be modified in place, |
|
|
|
|
so you can use git to monitor the changes. |
|
|
|
|
directory inside your pybind11 git clone. |
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:15-bullseye |
|
|
|
|
apt-get update && apt-get install -y git python3-dev python3-pytest |
|
|
|
|
cmake -S /mounted_pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);--use-color" -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17 |
|
|
|
|
cmake --build build -j 2 |
|
|
|
|
docker run --rm -v $PWD:/pybind11 -w /pybind11 -it silkeh/clang:20 |
|
|
|
|
apt-get update && apt-get install -y git python3-dev python3-pytest ninja-build |
|
|
|
|
cmake --preset tidy |
|
|
|
|
cmake --build --preset tidy |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
You can add `--fix` to the options list if you want. |
|
|
|
|
You can add `--fix` to the options list in the preset if you want to apply fixes |
|
|
|
|
(remember `-j1` to run only one thread). |
|
|
|
|
|
|
|
|
|
### Include what you use |
|
|
|
|
|
|
|
|
@ -281,7 +281,7 @@ macOS), then run:
@@ -281,7 +281,7 @@ macOS), then run:
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
cmake -S . -B build-iwyu -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=$(which include-what-you-use) |
|
|
|
|
cmake --build build |
|
|
|
|
cmake --build build-iwyu |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
The report is sent to stderr; you can pipe it into a file if you wish. |
|
|
|
|