Add a note about pre-commit hook dependencies (#1220)

This commit is contained in:
Sergey Kuznetsov
2024-02-28 16:32:32 +00:00
committed by GitHub
parent a7f61c3e68
commit b3e63b2491

View File

@@ -20,6 +20,11 @@ Please run the following command in order to use git hooks that are helpful for
git config --local core.hooksPath .githooks
```
## Git hooks dependencies
The pre-commit hook requires `clang-format >= 17.0.0` and `cmake-format` to be installed on your machine.
`clang-format` can be installed using `brew` on macOS and default package manager on Linux.
`cmake-format` can be installed using `pip`.
## Git commands
This sections offers a detailed look at the git commands you will need to use to get your PR submitted.
Please note that there are more than one way to do this and these commands are provided for your convenience.
@@ -63,8 +68,8 @@ git push --force
```
## Use ccache (optional)
Clio uses ccache to speed up compilation. If you want to use it, please make sure it is installed on your machine.
CMake will automatically detect it and use it if it's available.
Clio uses `ccache` to speed up compilation. If you want to use it, please make sure it is installed on your machine.
CMake will automatically detect it and use it if it is available.
## Fixing issues found during code review
@@ -97,7 +102,8 @@ This is a non-exhaustive list of recommended style guidelines. These are not alw
## Formatting
Code must conform to `clang-format` version 17, unless the result would be unreasonably difficult to read or maintain.
To change your code to conform use `clang-format -i <your changed files>`.
In most cases the pre-commit hook will take care of formatting and will fix any issues automatically.
To manually format your code, use `clang-format -i <your changed files>` for C++ files and `cmake-format -i <your changed files>` for CMake files.
## Avoid
* Proliferation of nearly identical code.