Skip to content

Commit 71683f3

Browse files
authored
chore: remove pre-push from default install hook types (#11072)
1 parent 2357af9 commit 71683f3

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# P40 — security scanners
77
# P50 — dependency validation
88

9-
default_install_hook_types: [pre-commit, pre-push]
9+
default_install_hook_types: [pre-commit]
1010

1111
repos:
1212
## GENERAL (prek built-in — no external repo needed)
@@ -62,12 +62,7 @@ repos:
6262
- id: autoflake
6363
name: "SDK - autoflake"
6464
files: { glob: ["{prowler,tests,dashboard,util,scripts}/**/*.py"] }
65-
args:
66-
[
67-
"--in-place",
68-
"--remove-all-unused-imports",
69-
"--remove-unused-variable",
70-
]
65+
args: ["--in-place", "--remove-all-unused-imports", "--remove-unused-variable"]
7166
priority: 20
7267

7368
- repo: https://github.com/pycqa/isort
@@ -179,8 +174,7 @@ repos:
179174
language: system
180175
types: [python]
181176
files: '.*\.py'
182-
exclude:
183-
{ glob: ["{contrib,skills}/**", "**/.venv/**", "**/*_test.py"] }
177+
exclude: { glob: ["{contrib,skills}/**", "**/.venv/**", "**/*_test.py"] }
184178
priority: 40
185179

186180
- id: safety
@@ -190,16 +184,7 @@ repos:
190184
entry: safety check --policy-file .safety-policy.yml
191185
language: system
192186
pass_filenames: false
193-
files:
194-
{
195-
glob:
196-
[
197-
"**/pyproject.toml",
198-
"**/poetry.lock",
199-
"**/requirements*.txt",
200-
".safety-policy.yml",
201-
],
202-
}
187+
files: { glob: ["**/pyproject.toml", "**/poetry.lock", "**/requirements*.txt", ".safety-policy.yml"] }
203188
priority: 40
204189

205190
- id: vulture

docs/developer-guide/introduction.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ prek installed at `.git/hooks/pre-commit`
134134
If pre-commit hooks were previously installed, run `prek install --overwrite` to replace the existing hook. Otherwise, both tools will run on each commit.
135135
</Warning>
136136

137+
#### Enable TruffleHog as a Pre-Push Hook
138+
139+
By default, only `pre-commit` hooks are installed. To enable [`TruffleHog`](https://github.com/trufflesecurity/trufflehog) secret scanning on every push, install the `pre-push` hook type explicitly:
140+
141+
```shell
142+
prek install --hook-type pre-push
143+
```
144+
145+
Successful installation should produce the following output:
146+
147+
```shell
148+
prek installed at `.git/hooks/pre-push`
149+
```
150+
151+
Once installed, TruffleHog runs before each push and blocks the operation when verified secrets are detected.
152+
137153
### Code Quality and Security Checks
138154

139155
Before merging pull requests, several automated checks and utilities ensure code security and updated dependencies:

0 commit comments

Comments
 (0)