Skip to content

Commit c4399aa

Browse files
committed
[precommit] Fixed just-fail pre-commit to only fail if staged files match regex
1 parent 4ee66e3 commit c4399aa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/Gaspi/pre-commit-hooks
3-
rev: v0.4
3+
rev: v0.5
44
hooks:
55
# Validate schemas using the jsonschema.validators package
66
- id: validate-json-schemas
@@ -20,8 +20,12 @@ repos:
2020
- --check-defaults
2121
# Just fail if any modification occurs to files in the charts/ folder
2222
# other than jupyter-py{spark,thon}, rstudio[-sparkr] or vscode-py{thon,spark}
23-
- id: just-fail
24-
exclude: "^((?!charts/)|(charts/(library-chart|jupyter-python|jupyter-pyspark|rstudio|rstudio-sparkr|vscode-python|vscode-pyspark)/)).*$"
23+
- id: check-match
24+
args:
25+
- --regex
26+
- "^charts/(?!(library-chart|jupyter-python|jupyter-pyspark|rstudio|rstudio-sparkr|vscode-python|vscode-pyspark)/).*$"
27+
pass_filenames: false
28+
always_run: true
2529
# Ensure that the Chart.yaml version is bumped in all charts with staged modifications *in the `main` branch only*
2630
- id: version-bump
2731
exclude: "charts/(?!(library-chart|(jupyter-py(spark|thon)/.*)|(rstudio(-sparkr)?/.*)|(vscode-py(thon|spark)/.*)))"

0 commit comments

Comments
 (0)