feat: re-introduce git hooks
Now using the standardized method from the CB. ref: N25B-367
This commit is contained in:
20
README.md
20
README.md
@@ -134,18 +134,22 @@ For coverage, add `--cov=robot_interface` as an argument to `pytest`.
|
||||
|
||||
|
||||
|
||||
## GitHooks
|
||||
## Git Hooks
|
||||
|
||||
To activate automatic commits/branch name checks run:
|
||||
To activate automatic linting, formatting, branch name checks and commit message checks, run (after installing requirements):
|
||||
|
||||
```shell
|
||||
git config --local core.hooksPath .githooks
|
||||
```bash
|
||||
pre-commit install
|
||||
pre-commit install --hook-type commit-msg
|
||||
```
|
||||
|
||||
If your commit fails its either:
|
||||
branch name != <type>/description-of-branch ,
|
||||
commit name != <type>: description of the commit.
|
||||
<ref>: N25B-Num's
|
||||
You might get an error along the lines of `Can't install pre-commit with core.hooksPath` set. To fix this, simply unset the hooksPath by running:
|
||||
|
||||
```bash
|
||||
git config --local --unset core.hooksPath
|
||||
```
|
||||
|
||||
Then run the pre-commit install commands again.
|
||||
|
||||
## Documentation
|
||||
Generate documentation web pages using:
|
||||
|
||||
Reference in New Issue
Block a user