Skip to content

Commit 5db7b0f

Browse files
committed
feat: upgraded config file
1 parent d6a5f09 commit 5db7b0f

File tree

1 file changed

+52
-54
lines changed

1 file changed

+52
-54
lines changed

.pre-commit-config.yaml

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ----------------------------------------------------------------------
2-
# Pre‑commit Configuration for go-safe-conversion
2+
# Pre‑commit Configuration for the local repository
33
#
44
# Purpose: Enforce code quality, security, and COMMENTING RULES defined
55
# in .github/AGENTS.md before any commit reaches the repository.
@@ -15,62 +15,60 @@
1515
minimum_pre_commit_version: "3.7.0" # requires Python‑based hooks v2.0+
1616

1717
repos:
18-
# ---------------------- Core hygiene hooks --------------------------
19-
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v4.6.0
21-
hooks:
22-
- id: check-added-large-files
23-
- id: end-of-file-fixer
24-
- id: trailing-whitespace
25-
- id: check-merge-conflict
18+
# ---------------------- Core hygiene hooks --------------------------
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
21+
hooks:
22+
- id: check-added-large-files
23+
- id: end-of-file-fixer
24+
- id: trailing-whitespace
25+
- id: check-merge-conflict
2626

27-
# ------------------------- Go toolchain -----------------------------
28-
- repo: https://github.com/dnephin/pre-commit-golang
29-
rev: v1.5.2
30-
hooks:
31-
- id: go-fmt
32-
- id: go-imports
33-
- id: go-vet
34-
- id: golangci-lint
35-
args: [ "--config=.golangci.json --verbose" ]
27+
# ------------------------- Go toolchain -----------------------------
28+
- repo: https://github.com/TekWizely/pre-commit-golang
29+
rev: 302c7fd28cdbb62d5fd1e3965fe36e33a5f77803 # frozen: v1.0.0-rc.1
30+
hooks:
31+
- id: go-fmt
32+
- id: go-vet
33+
- id: go-lint
34+
- id: go-imports
35+
- id: golangci-lint
36+
- id: go-mod-tidy
3637

37-
# ------------------------ Security scans ---------------------------
38-
- repo: https://github.com/zricethezav/gitleaks
39-
rev: v8.18.2
40-
hooks:
41-
- id: gitleaks
42-
stages: [ commit, push ]
38+
# ------------------------ Security scans ---------------------------
39+
- repo: https://github.com/zricethezav/gitleaks
40+
rev: 47218a628da59ef6b24197d15f4b0248ca87f4f0 # frozen: v8.27.2
41+
hooks:
42+
- id: gitleaks
43+
stages: [ pre-commit, pre-push ]
4344

44-
# ------------------- Commenting rule enforcement -------------------
45-
- repo: local
46-
hooks:
47-
- id: revive-comment-style
48-
name: "revive: enforce GoDoc & comment style from AGENTS.md"
49-
language: system
50-
entry: |
51-
bash -c 'revive -config .revive.toml ./...'
52-
types: [ go ]
53-
fail_fast: true
45+
# ------------------- Commenting rule enforcement -------------------
46+
- repo: local
47+
hooks:
48+
- id: revive-comment-style
49+
name: "revive: enforce GoDoc & comment style from AGENTS.md"
50+
language: system
51+
entry: |
52+
bash -c 'revive -config .revive.toml ./...'
53+
types: [ go ]
54+
fail_fast: true
5455

55-
- id: comment-conventions
56-
name: "custom comment linter (AGENTS.md)"
57-
language: python
58-
entry: scripts/comment_lint.py
59-
types: [ go, markdown ]
60-
pass_filenames: true
61-
additional_dependencies:
62-
- regex==2025.6
63-
- ruamel.yaml==0.18
56+
- id: comment-conventions
57+
name: "custom comment linter (AGENTS.md)"
58+
language: python
59+
entry: scripts/comment_lint.py
60+
types: [ go, markdown ]
61+
pass_filenames: true
62+
additional_dependencies:
63+
- regex==2025.6
64+
- ruamel.yaml==0.18
6465

65-
# --------------------- Commit‑msg validation -----------------------
66-
- repo: https://github.com/antham/commitlint
67-
rev: v0.7.0
68-
hooks:
69-
- id: commitlint
70-
stages: [ commit-msg ]
71-
entry: commitlint -g .github/commitlint.config.js
72-
additional_dependencies:
73-
- "@commitlint/config-conventional@19.3.0"
74-
- "@commitlint/cli@19.3.0"
66+
# --------------------- Commit‑msg validation -----------------------
67+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
68+
rev: 879f5400493f84c8b683bdeb3366a8439ca17858 # frozen: v9.22.0
69+
hooks:
70+
- id: commitlint
71+
stages: [ commit-msg ]
72+
additional_dependencies: [ '@commitlint/config-conventional' ]
7573

76-
default_stages: [commit, push]
74+
default_stages: [ pre-commit, pre-push ]

0 commit comments

Comments
 (0)