Skip to content

Commit ab6b77c

Browse files
committed
chore: standardize pre-commit hooks
1 parent e03d411 commit ab6b77c

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v6.0.0
44
hooks:
5-
- id: trailing-whitespace
6-
name: trim trailing whitespace
5+
- id: check-yaml
6+
- id: check-json
7+
files: \.json$
8+
- id: check-merge-conflict
9+
name: check for merge conflicts
710
- id: end-of-file-fixer
811
name: fix end of files
12+
- id: trailing-whitespace
13+
name: trim trailing whitespace
14+
- id: no-commit-to-branch
15+
args: ['--branch', 'master']
916
- id: check-added-large-files
1017
name: check for added large files
11-
- id: check-merge-conflict
12-
name: check for merge conflicts
1318
- id: detect-private-key
1419
name: detect private key
1520
- id: mixed-line-ending
@@ -20,6 +25,11 @@ repos:
2025
- id: check-shebang-scripts-are-executable
2126
name: check shebang scripts are executable
2227

28+
- repo: https://github.com/rhysd/actionlint
29+
rev: v1.7.7
30+
hooks:
31+
- id: actionlint
32+
2333
- repo: https://github.com/Yelp/detect-secrets
2434
rev: v1.5.0
2535
hooks:
@@ -38,9 +48,21 @@ repos:
3848

3949
- repo: local
4050
hooks:
51+
- id: shfmt
52+
name: shfmt
53+
entry: shfmt
54+
language: system
55+
args: [--diff, --indent, '2', --case-indent, --binary-next-line]
56+
types: [shell]
4157
- id: bash-syntax
4258
name: bash syntax check
4359
entry: bash -n
4460
language: system
4561
types: [shell]
4662
exclude: '^\.env'
63+
64+
- repo: https://github.com/adrienverge/yamllint
65+
rev: v1.35.1
66+
hooks:
67+
- id: yamllint
68+
args: [--config-file, .yamllint.yml]

.yamllint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: default
2+
3+
rules:
4+
line-length:
5+
max: 200
6+
truthy:
7+
check-keys: false
8+
comments:
9+
min-spaces-from-content: 1
10+
document-start: disable

0 commit comments

Comments
 (0)