Skip to content

Commit 8111083

Browse files
committed
ci(FCL-176): Make pre-commit-hooks consistent across repos
Pre-commit gives us a set of high-level hooks which rapidly sense-check aspects of the repository. This commit adds new ones for preventing the addition of large files, checking for filename casing conflicts, preventing committing of files with open merge conflicts, checking XML validity, preventing the addition of submodules, warning when files have mixed line endings, and accidentally committing to `main`. It also reorders this list for clarity.
1 parent 32562f8 commit 8111083

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

.pre-commit-config.yaml

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
exclude: "^docs/|/migrations/"
2-
default_install_hook_types: [pre-commit, pre-push]
3-
41
repos:
52
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.5.0
3+
rev: v4.6.0
74
hooks:
8-
- id: trailing-whitespace
9-
- id: end-of-file-fixer
10-
- id: check-yaml
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-json
8+
exclude: src/main/rest-api.json # This is a template file, not actual JSON
9+
- id: check-merge-conflict
1110
- id: check-xml
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
- id: forbid-submodules
14+
- id: mixed-line-ending
15+
- id: no-commit-to-branch
16+
- id: trailing-whitespace
1217

1318
- repo: local
1419
hooks:
@@ -37,9 +42,3 @@ repos:
3742
hooks:
3843
- id: ruff
3944
args: [--fix, --exit-non-zero-on-fix]
40-
41-
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
42-
ci:
43-
autoupdate_schedule: weekly
44-
skip: []
45-
submodules: false

0 commit comments

Comments
 (0)