Skip to content

Commit 219baaf

Browse files
committed
refactor: updated pre-commit hooks & repos
1 parent 1ce0a72 commit 219baaf

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ repos:
44
rev: v4.9.1
55
hooks:
66
- id: commitizen
7-
# - id: commitizen-branch
7+
stages: [commit-msg]
8+
- id: commitizen-branch
9+
stages: [pre-push]
810
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v2.3.0
11+
rev: v6.0.0
1012
hooks:
1113
- id: check-yaml
14+
stages: [pre-commit]
1215
- id: end-of-file-fixer
16+
stages: [pre-commit]
1317
- id: trailing-whitespace
18+
stages: [pre-commit]
19+
- id: pretty-format-json
20+
stages: [pre-commit]
21+
- id: check-merge-conflict
22+
stages: [pre-commit]
1423
- repo: https://github.com/psf/black
15-
rev: 22.10.0
24+
rev: 25.9.0
1625
hooks:
1726
- id: black

linux/systems/.local/bin/org.jcchikikomori.dotfiles/bin/dotfiles-git-repo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ set -eu
33

44
precommit() {
55
cp -f $HOME/.dotfiles/linux/git/.pre-commit-config.yaml .
6-
pre-commit install --hook-type commit-msg
6+
pre-commit autoupdate
7+
pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push
78
}
89

910
# TODO: Check if .git folder/directory exists
@@ -12,11 +13,11 @@ initial() {
1213
}
1314

1415
if [ "$1" = "initialize" ]; then
15-
echo "[dotfiles-git-repo] Initializing..."
16+
echo "[dotfiles-git-repo] Initializing"
1617
initial
1718
exit 0
1819
elif [ "$1" = "precommit" ]; then
19-
echo "[dotfiles-git-repo] Installing pre-commit..."
20+
echo "[dotfiles-git-repo] Initializing"
2021
precommit
2122
exit 0
2223
elif [ "$1" = "validate" ]; then

0 commit comments

Comments
 (0)