Tools for Developers¶
Using Pre-Commit Hooks¶
Use the .pre-commit-config.yaml file to apply clang-format on before commits.
Steps:
pip install pre-commitpre-commit installgit add . && git commit -m "My commit message"
Hopefully, that will avoid upsetting the GitHub checks.
Clang-Tidy¶
To run locally:
cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..: this exports a JSON describing how all the files will be compiledcd ..; run-clang-tidy -quiet -p build $(find src -name '*.cpp')
You can also tack on a -j <N> to run-clang-tidy to make it parallel.