feat: re-introduce git hooks

Now using the standardized method from the CB.

ref: N25B-367
This commit is contained in:
Twirre Meulenbelt
2025-12-02 22:04:46 +01:00
parent f469e4ce36
commit 94b92b3e4a
8 changed files with 240 additions and 50 deletions

View File

@@ -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: