Add clang tidy (#864)

Fixes #863
This commit is contained in:
Sergey Kuznetsov
2023-10-03 10:43:54 +01:00
committed by GitHub
parent 69f5025a29
commit 4b53bef1f5
198 changed files with 2168 additions and 1288 deletions

View File

@@ -237,6 +237,21 @@ Clio will fallback to hardcoded defaults when not specified in the config file o
of the minimum and maximum supported versions hardcoded in `src/rpc/common/APIVersion.h`.
> **Note:** See `example-config.json` for more details.
## Using clang-tidy for static analysis
Minimum clang-tidy version required is 16.0.
Clang-tidy could be run by cmake during building the project.
For that provide the option `-o lint=True` for `conan install` command:
```sh
conan install .. --output-folder . --build missing --settings build_type=Release -o tests=True -o lint=True
```
By default cmake will try to find clang-tidy automatically in your system.
To force cmake use desired binary set `CLIO_CLANG_TIDY_BIN` environment variable as path to clang-tidy binary.
E.g.:
```sh
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@16/bin/clang-tidy
```
## Developing against `rippled` in standalone mode
If you wish you develop against a `rippled` instance running in standalone