Skip to content

Commit 3b608f4

Browse files
committed
chore: Update pre-commit hooks and noxfile.py for better code quality and CI/CD
Update pre-commit hooks to use ruff for code linting and add new nox sessions for ruff, build, and release. Signed-off-by: longhao <[email protected]>
1 parent 64e368b commit 3b608f4

File tree

3 files changed

+311
-227
lines changed

3 files changed

+311
-227
lines changed

.pre-commit-config.yaml

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
exclude: conf.py
22
repos:
3-
- repo: https://github.com/ambv/black
4-
rev: 22.12.0
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.1.9
5+
hooks:
6+
- id: ruff
7+
args: [--fix]
8+
- id: ruff-format
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.5.0
511
hooks:
6-
- id: black
7-
language_version: python3.10
8-
- hooks:
912
- id: trailing-whitespace
1013
- id: end-of-file-fixer
1114
- id: check-docstring-first
@@ -14,43 +17,52 @@ repos:
1417
- id: debug-statements
1518
- id: name-tests-test
1619
- id: requirements-txt-fixer
17-
repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v2.4.0
19-
- hooks:
20+
- id: check-added-large-files
21+
- id: check-merge-conflict
22+
- repo: https://github.com/pre-commit/mirrors-mypy
23+
rev: v1.7.1
24+
hooks:
25+
- id: mypy
26+
additional_dependencies: [types-all]
27+
- repo: https://github.com/asottile/pyupgrade
28+
rev: v3.15.0
29+
hooks:
30+
- id: pyupgrade
31+
args: [--py37-plus]
32+
- repo: https://github.com/ambv/black
33+
rev: 22.12.0
34+
hooks:
35+
- id: black
36+
language_version: python3.10
37+
- repo: https://github.com/pycqa/flake8
38+
rev: 3.7.9
39+
hooks:
2040
- additional_dependencies:
2141
- flake8-typing-imports==1.5.0
2242
id: flake8
23-
repo: https://github.com/pycqa/flake8
24-
rev: 3.7.9
25-
- hooks:
26-
- id: autopep8
27-
repo: https://github.com/pre-commit/mirrors-autopep8
43+
- repo: https://github.com/pre-commit/mirrors-autopep8
2844
rev: v1.4.4
29-
- hooks:
30-
- id: validate_manifest
31-
repo: https://github.com/pre-commit/pre-commit
45+
hooks:
46+
- id: autopep8
47+
- repo: https://github.com/pre-commit/pre-commit
3248
rev: v1.21.0
33-
- hooks:
34-
- args:
35-
- --py36-plus
36-
id: pyupgrade
37-
repo: https://github.com/asottile/pyupgrade
38-
rev: v1.25.3
39-
- hooks:
49+
hooks:
50+
- id: validate_manifest
51+
- repo: https://github.com/asottile/reorder_python_imports
52+
rev: v1.9.0
53+
hooks:
4054
- args:
4155
- --py3-plus
4256
id: reorder-python-imports
43-
repo: https://github.com/asottile/reorder_python_imports
44-
rev: v1.9.0
45-
- hooks:
57+
- repo: https://github.com/asottile/add-trailing-comma
58+
rev: v1.5.0
59+
hooks:
4660
- args:
4761
- --py36-plus
4862
id: add-trailing-comma
49-
repo: https://github.com/asottile/add-trailing-comma
50-
rev: v1.5.0
51-
- hooks:
63+
- repo: https://github.com/commitizen-tools/commitizen
64+
rev: v2.17.8
65+
hooks:
5266
- id: commitizen
5367
stages:
5468
- commit-msg
55-
repo: https://github.com/commitizen-tools/commitizen
56-
rev: v2.17.8

0 commit comments

Comments
 (0)