mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
feat: migrate from pre-commit to prek
Replace pre-commit with prek, a faster Rust-based alternative that is 7x faster for installation and 6x faster for execution while being fully compatible with .pre-commit-config.yaml. Changes: - Remove pre-commit from pyproject.toml dev dependencies - Update scripts/setup-git-hooks.sh to use prek - Update developer documentation (introduction.mdx) - Update security documentation (software-security.mdx) - Update AGENTS.md files with new commands - Regenerate poetry.lock prek is installed as a standalone tool via: - pipx install prek (recommended) - brew install prek - uv tool install prek Benchmarks on Prowler codebase: - Cold install: 25.18s → 3.42s (7.37x faster) - Warm execution: 87.53s → 14.80s (5.92x faster) - Cache size: 170MB → 154MB (9.4% smaller)
This commit is contained in:
@@ -116,18 +116,34 @@ In case you have any doubts, consult the [Poetry environment activation guide](h
|
||||
</Warning>
|
||||
|
||||
|
||||
### Pre-Commit Hooks
|
||||
### Git Hooks with prek
|
||||
|
||||
This repository uses Git pre-commit hooks managed by the [pre-commit](https://pre-commit.com/) tool, it is installed with `poetry install --with dev`. Next, run the following command in the root of this repository:
|
||||
This repository uses Git hooks managed by [prek](https://github.com/j178/prek), a fast pre-commit alternative written in Rust. It is ~7x faster than traditional pre-commit while being fully compatible with `.pre-commit-config.yaml`.
|
||||
|
||||
Install prek (choose one method):
|
||||
|
||||
```shell
|
||||
pre-commit install
|
||||
pipx install prek # recommended
|
||||
# or: brew install prek
|
||||
# or: uv tool install prek
|
||||
```
|
||||
|
||||
Then run the following command in the root of this repository:
|
||||
|
||||
```shell
|
||||
prek install
|
||||
```
|
||||
|
||||
Successful installation should produce the following output:
|
||||
|
||||
```shell
|
||||
pre-commit installed at .git/hooks/pre-commit
|
||||
prek hook installed at .git/hooks/pre-commit
|
||||
```
|
||||
|
||||
To run hooks manually on all files:
|
||||
|
||||
```shell
|
||||
prek run --all-files
|
||||
```
|
||||
|
||||
### Code Quality and Security Checks
|
||||
|
||||
Reference in New Issue
Block a user