Skip to content

Commit 2b7604f

Browse files
feat: add .pre-commit-config.yaml
1 parent e571e4b commit 2b7604f

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.github/md-link-config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http://localhost"
5+
},
6+
{
7+
"pattern": "^http://0.0.0.0"
8+
}
9+
],
10+
"httpHeaders": [
11+
{
12+
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
13+
"headers": {
14+
"Accept-Encoding": "zstd, br, gzip, deflate"
15+
}
16+
}
17+
],
18+
"timeout": "20s",
19+
"retryOn429": true,
20+
"retryCount": 5,
21+
"fallbackRetryDelay": "30s",
22+
"aliveStatusCodes": [200, 206, 429]
23+
}

.pre-commit-config.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 25.1.0
4+
hooks:
5+
- id: black
6+
args: ["--line-length=120"]
7+
- repo: https://github.com/PyCQA/flake8
8+
rev: 7.2.0
9+
hooks:
10+
- id: flake8
11+
args: [
12+
"--select=E,F",
13+
"--ignore=E741,E731,E722,E721,E501,E402,E266,E265,E262,E203,F403,F405",
14+
"--exclude=**/__init__.py",
15+
"--max-line-length=120"
16+
]
17+
- repo: https://github.com/PyCQA/isort
18+
rev: 6.0.1
19+
hooks:
20+
- id: isort
21+
- repo: https://github.com/codespell-project/codespell
22+
rev: v2.4.1
23+
hooks:
24+
- id: codespell
25+
args: ["--skip=*.po,*.ts,*.css", "--ignore-regex=\\b\\w{2,3}\\b"]
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v4.3.0
28+
hooks:
29+
- id: trailing-whitespace
30+
- id: check-yaml
31+
- id: end-of-file-fixer
32+
- id: requirements-txt-fixer
33+
- id: double-quote-string-fixer
34+
- id: check-merge-conflict
35+
- id: fix-encoding-pragma
36+
args: ["--remove"]
37+
- id: mixed-line-ending
38+
args: ["--fix=lf"]
39+
- id: detect-private-key
40+
- id: check-json
41+
- repo: https://github.com/executablebooks/mdformat
42+
rev: 0.7.9
43+
hooks:
44+
- id: mdformat
45+
args: ["--number", "--table-width", "200"]
46+
additional_dependencies:
47+
- mdformat-openmmlab
48+
- mdformat_frontmatter
49+
- linkify-it-py
50+
- repo: https://github.com/myint/docformatter
51+
rev: v1.7.7
52+
hooks:
53+
- id: docformatter
54+
language: python
55+
args: ["--in-place", "--wrap-descriptions", "79"]
56+
- repo: https://github.com/jackdewinter/pymarkdown
57+
rev: v0.9.30
58+
hooks:
59+
- id: pymarkdown
60+
args: [fix]
61+
- repo: https://github.com/gitleaks/gitleaks
62+
rev: v8.27.0
63+
hooks:
64+
- id: gitleaks
65+
entry: "gitleaks dir"
66+
args: [
67+
"--verbose",
68+
"--redact=50"
69+
]
70+
- repo: https://github.com/PyCQA/pylint/
71+
rev: v3.3.7
72+
hooks:
73+
- id: pylint
74+
name: pylint
75+
entry: pylint
76+
language: system
77+
types: [python]
78+
require_serial: false
79+
args:
80+
[ "--jobs=4",
81+
"--disable=all",
82+
"--enable=E,F",
83+
"--disable=E0401,E0402,E0102,E1101",
84+
"-sn"
85+
]
86+
- repo: https://github.com/tcort/markdown-link-check
87+
rev: v3.12.2
88+
hooks:
89+
- id: markdown-link-check
90+
args: [-q,-c, ./.github/md-link-config.json]

0 commit comments

Comments
 (0)