@ministryofjustice/hmpps-precommit-hooks 2.0.0-beta.4 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bin/prepare.sh +7 -0
- package/default-hooks.yaml +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,10 +45,10 @@ HMPPS_HOOKS_VERSION: 1
|
|
|
45
45
|
repos:
|
|
46
46
|
- repo: local
|
|
47
47
|
hooks:
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
- id: gitleaks
|
|
49
|
+
name: Scan commit for secrets
|
|
50
|
+
language: system
|
|
51
|
+
entry: gitleaks git --pre-commit --redact --staged --verbose --config .gitleaks/config.toml --gitleaks-ignore-path .gitleaks/.gitleaksignore
|
|
52
52
|
- id: lint
|
|
53
53
|
name: linting code
|
|
54
54
|
language: system
|
|
@@ -111,7 +111,7 @@ See the gitleaks documentation for how to create rules and [examples](https://gi
|
|
|
111
111
|
|
|
112
112
|
### Keeping up to date
|
|
113
113
|
|
|
114
|
-
`prek auto-update` can be used to pull in later versions of hooks
|
|
114
|
+
`prek auto-update` can be used to pull in later versions of hooks.
|
|
115
115
|
|
|
116
116
|
Also, a manager can be added to your renovate.json config to allow renovate to raise PRs to keep hooks up to date:
|
|
117
117
|
|
package/bin/prepare.sh
CHANGED
|
@@ -40,6 +40,13 @@ if ! command -v brew > /dev/null 2> /dev/null; then
|
|
|
40
40
|
exit 0
|
|
41
41
|
fi
|
|
42
42
|
|
|
43
|
+
# Install gitleaks if not present - this will be used by prek for secret scanning until we move over to devsecops hooks
|
|
44
|
+
if ! command -v gitleaks > /dev/null 2> /dev/null; then
|
|
45
|
+
startStage "Installing gitleaks"
|
|
46
|
+
brew install gitleaks
|
|
47
|
+
endStage " ✅ "
|
|
48
|
+
fi
|
|
49
|
+
|
|
43
50
|
# Install prek
|
|
44
51
|
if ! command -v prek > /dev/null 2> /dev/null; then
|
|
45
52
|
startStage "Installing prek"
|
package/default-hooks.yaml
CHANGED
|
@@ -5,12 +5,19 @@
|
|
|
5
5
|
# Other hooks maybe added or removed as needed to suit individual project requirements.
|
|
6
6
|
|
|
7
7
|
repos:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
#. Temporary disabled while we investigate issues with it
|
|
9
|
+
# - repo: https://github.com/ministryofjustice/devsecops-hooks
|
|
10
|
+
# rev: v1.1.0
|
|
11
|
+
# hooks:
|
|
12
|
+
# - id: baseline
|
|
12
13
|
- repo: local
|
|
13
14
|
hooks:
|
|
15
|
+
- id: gitleaks
|
|
16
|
+
name: Scan commit for secrets
|
|
17
|
+
language: system
|
|
18
|
+
entry: gitleaks git --pre-commit --redact --staged --verbose --config .gitleaks/config.toml --gitleaks-ignore-path .gitleaks/.gitleaksignore
|
|
19
|
+
require_serial: true
|
|
20
|
+
pass_filenames: false
|
|
14
21
|
- id: lint
|
|
15
22
|
name: linting code
|
|
16
23
|
language: system
|