Skip to content

Commit 139aa4a

Browse files
committed
Add more pre-commit check to the config
1 parent e782c52 commit 139aa4a

2 files changed

Lines changed: 37 additions & 15 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ jobs:
1414
steps:
1515
- name: Checkout repo
1616
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
with:
18+
# use commit hash to make "no-commit-to-branch" check passing
19+
ref: ${{ github.sha }}
1720

1821
- name: Set up python
1922
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2023
with:
21-
python-version: '3.13'
24+
python-version: '3.14'
2225

2326
- name: Set up pip packages
2427
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1

.pre-commit-config.yaml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v6.0.0
44
hooks:
5+
# Git
6+
- id: check-added-large-files
7+
- id: no-commit-to-branch
8+
name: "ensure no direct commit to master/maintenance branches"
9+
args: [--branch, "master", --pattern, "maintenance/.*"]
10+
- id: check-case-conflict
11+
- id: check-illegal-windows-names
12+
# Contents
513
- id: check-ast
614
- id: check-builtin-literals
715
- id: check-case-conflict
@@ -15,19 +23,19 @@ repos:
1523
- id: mixed-line-ending
1624
- id: trailing-whitespace
1725

18-
- repo: https://github.com/pre-commit/pygrep-hooks
19-
rev: v1.10.0
20-
hooks:
21-
- id: python-check-blanket-noqa
22-
- id: python-check-blanket-type-ignore
23-
- id: python-check-mock-methods
24-
- id: python-no-eval
25-
- id: python-no-log-warn
26-
- id: python-use-type-annotations
27-
- id: rst-backticks
28-
- id: rst-directive-colons
29-
- id: rst-inline-touching-normal
30-
- id: text-unicode-replacement-char
26+
- repo: https://github.com/pre-commit/pygrep-hooks
27+
rev: v1.10.0
28+
hooks:
29+
- id: python-check-blanket-noqa
30+
- id: python-check-blanket-type-ignore
31+
- id: python-check-mock-methods
32+
- id: python-no-eval
33+
- id: python-no-log-warn
34+
- id: python-use-type-annotations
35+
- id: rst-backticks
36+
- id: rst-directive-colons
37+
- id: rst-inline-touching-normal
38+
- id: text-unicode-replacement-char
3139

3240
- repo: https://github.com/codespell-project/codespell
3341
rev: v2.4.1
@@ -62,7 +70,7 @@ repos:
6270
args: ["--config=.flake8"]
6371
additional_dependencies:
6472
- flake8-docstrings==1.7.0
65-
- flake8-bugbear==24.4.26
73+
- flake8-bugbear==25.11.29
6674

6775
- repo: https://github.com/pycqa/isort
6876
rev: 8.0.0
@@ -102,3 +110,14 @@ repos:
102110
rev: 3.0.0
103111
hooks:
104112
- id: shellcheck
113+
114+
- repo: https://github.com/gitleaks/gitleaks
115+
rev: v8.30.0
116+
hooks:
117+
- id: gitleaks
118+
119+
- repo: https://github.com/rhysd/actionlint
120+
rev: v1.7.11
121+
hooks:
122+
- id: actionlint
123+
args: ["-ignore", "SC2317"]

0 commit comments

Comments
 (0)