Skip to content

Commit 4b6d3c6

Browse files
DevOpsDevOps
authored andcommitted
Merge branch 'feat/sync-precommit' of github-p.com:BerryBytes/precommit-util into feat/sync-precommit
2 parents 28c5b45 + ccebb60 commit 4b6d3c6

6 files changed

Lines changed: 165 additions & 0 deletions

File tree

.github/scripts/extract_config.sh

100644100755
File mode changed.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
repos:
2+
# ✅ Precommit hooks
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.4.0
5+
hooks:
6+
- id: check-yaml
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: check-added-large-files
10+
- id: check-vcs-permalinks
11+
- id: check-symlinks
12+
- id: destroyed-symlinks
13+
- id: pretty-format-json
14+
15+
# ✅ golang fmt and go tidey
16+
- repo: https://github.com/TekWizely/pre-commit-golang
17+
rev: v1.0.0-rc.1
18+
hooks:
19+
- id: go-fmt
20+
args: [-w]
21+
- id: go-mod-tidy # Ensure go.mod & go.sum are tidy
22+
23+
- repo: https://github.com/psf/black
24+
rev: 23.9.1
25+
hooks:
26+
- id: black
27+
args: [--line-length=88]
28+
# ✅ Import sorter (runs before Black)
29+
- repo: https://github.com/PyCQA/isort
30+
rev: 5.12.0
31+
hooks:
32+
- id: isort
33+
args: ["--profile=black"]
34+
35+
# ✅ Linter (flake8 for code quality)
36+
- repo: https://github.com/pycqa/flake8
37+
rev: 6.1.0
38+
hooks:
39+
- id: flake8
40+
args:
41+
- --max-line-length=88
42+
- --extend-ignore=E203,W503
43+
additional_dependencies:
44+
- flake8-bugbear
45+
- flake8-comprehensions
46+
- flake8-docstrings
47+
# ✅ Static code analysis for Python (pylint optional)
48+
- repo: https://github.com/pycqa/pylint
49+
rev: v3.2.6
50+
hooks:
51+
- id: pylint
52+
args: ["--disable=C0114,C0115,C0116"]
53+
additional_dependencies:
54+
- pylint-django
55+
- pylint-flask
56+
# ✅ Terraform docs
57+
- repo: https://github.com/terraform-docs/terraform-docs
58+
rev: "v0.16.0"
59+
hooks:
60+
- id: terraform-docs-go
61+
args: ["markdown", "table", "--output-file", "README.md", "./"]
62+
63+
# ✅ Terraform precommit
64+
- repo: https://github.com/antonbabenko/pre-commit-terraform
65+
rev: "v1.74.1"
66+
hooks:
67+
- id: terraform_fmt
68+
- id: terraform_validate
69+
- id: terraform_tflint
70+
- id: terraform_tfsec
71+
72+
# ✅ Stylelint
73+
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
74+
rev: v15.10.3
75+
hooks:
76+
- id: stylelint
77+
files: \.(css|scss)$
78+
exclude: "node_modules/"
79+
additional_dependencies:
80+
- stylelint
81+
- stylelint-config-standard
82+
args: ['--config', '.stylelintrc.json', '--fix']
83+
84+
# ✅ Codespell
85+
- repo: https://github.com/codespell-project/codespell
86+
rev: v2.2.5
87+
hooks:
88+
- id: codespell
89+
files: ^.*\.(py|c|h|md|rst|yml|go|sh|sql|tf|yaml)$
90+
args: ["--ignore-words-list", "hist,nd"]
91+
# ✅ Gitleaks
92+
- repo: https://github.com/gitleaks/gitleaks
93+
rev: v8.21.0
94+
hooks:
95+
- id: gitleaks
96+
args: ["detect", "--verbose"]
97+
verbose: true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
args: ["--allow-multiple-documents"]
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: check-added-large-files
10+
- id: check-vcs-permalinks
11+
- id: check-symlinks
12+
- id: destroyed-symlinks
13+
14+
- repo: https://github.com/TekWizely/pre-commit-golang
15+
rev: v1.0.0-rc.1
16+
hooks:
17+
- id: go-fmt
18+
args: [-w]
19+
- id: go-mod-tidy # Ensure go.mod & go.sum are tidy
20+
21+
22+
- repo: https://github.com/codespell-project/codespell
23+
rev: v2.2.5
24+
hooks:
25+
- id: codespell
26+
files: ^.*\.(py|c|h|md|rst|yml|go|sh|sql|tf|yaml)$
27+
exclude: ^.*(_test\.go|\.min\.js|\.map)$
28+
args: ["--ignore-words-list", "hist,nd"]
29+
30+
- repo: https://github.com/zricethezav/gitleaks
31+
rev: v8.18.0
32+
hooks:
33+
- id: gitleaks
34+
args: ["detect", "--verbose"]

python/precommitFile/.pre-commit-config.yaml

Whitespace-only changes.

terraform/precommitFile/.pre-commit-config.yaml

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
10+
# - repo: https://github.com/pre-commit/mirrors-prettier
11+
# rev: v3.1.0
12+
# hooks:
13+
# - id: prettier
14+
# files: \.(js|jsx|ts|tsx|css|html|json)$
15+
# types: [file]
16+
# exclude: "node_modules/"
17+
# args: ['--config', '.prettierrc']
18+
19+
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
20+
rev: v15.10.3
21+
hooks:
22+
- id: stylelint
23+
files: \.(css|scss)$
24+
exclude: "node_modules/"
25+
additional_dependencies:
26+
- stylelint
27+
- stylelint-config-standard
28+
args: ['--config', '.stylelintrc.json', '--fix']
29+
30+
- repo: https://github.com/gitleaks/gitleaks
31+
rev: v8.21.0
32+
hooks:
33+
- id: gitleaks
34+
args: ["detect", "--verbose"]

0 commit comments

Comments
 (0)