chore: Add pre-push hooks

Adding pre-push hooks to cloudflared. While developing in cloudflared, I found myself constantly bumping into issues in CI, as I was forgetting to run linters and tests at times. We should run these before pushing any code to our repo.
This commit is contained in:
Miguel da Costa Martins Marcelino
2026-04-29 13:09:22 +00:00
parent df981b4d89
commit f827e6216b
3 changed files with 43 additions and 1 deletions
+8 -1
View File
@@ -79,4 +79,11 @@ To locally run the tests run `make test`
To format the code and keep a good code quality use `make fmt` and `make lint`
### Mocks
After changes on interfaces you might need to regenerate the mocks, so run `make mock`
After changes on interfaces you might need to regenerate the mocks, so run `make mocks`
### Git Hooks
To avoid CI errors, you can install pre-push hooks that run linting and tests before each push:
```bash
make install-hooks
```
This will configure git to use the hooks in `.githooks/` that run `make fmt-check lint test` before each push.