@@ -21,50 +21,14 @@ repos:
2121 name : Check conventional commit message
2222 stages : [commit-msg]
2323
24- # Sort imports .
25- - repo : https://github.com/pycqa/isort
26- rev : dac090ce4d9ee313d086e2e89ab1acb8c2664fa1 # frozen: 9.0.0a3
24+ # Ruff formats and lints code .
25+ - repo : https://github.com/astral-sh/ruff-pre-commit
26+ rev : 3b3f7c3f57fe9925356faf5fe6230835138be230 # frozen: v0.15.17
2727 hooks :
28- - id : isort
29- name : Sort import statements
30- args : [--settings-path, pyproject.toml]
31- stages : [pre-commit]
32-
33- # Add Black code formatters.
34- - repo : https://github.com/ambv/black
35- rev : c6755bb741b6481d6b3d3bb563c83fa060db96c9 # frozen: 26.3.1
36- hooks :
37- - id : black
38- name : Format code
28+ - id : ruff-format
3929 args : [--config, pyproject.toml]
40- - repo : https://github.com/asottile/blacken-docs
41- rev : dda8db18cfc68df532abf33b185ecd12d5b7b326 # frozen: 1.20.0
42- hooks :
43- - id : blacken-docs
44- name : Format code in docstrings
45- args : [--line-length, '120']
46- additional_dependencies : [black==26.3.1]
47-
48- # Upgrade and rewrite Python idioms.
49- - repo : https://github.com/asottile/pyupgrade
50- rev : 75992aaa40730136014f34227e0135f63fc951b4 # frozen: v3.21.2
51- hooks :
52- - id : pyupgrade
53- name : Upgrade code idioms
54- files : ^src/package/|^tests/
55- args : [--py310-plus]
56-
57- # Similar to pylint, with a few more/different checks. For more available
58- # extensions: https://github.com/DmytroLitvinov/awesome-flake8-extensions
59- - repo : https://github.com/pycqa/flake8
60- rev : d93590f5be797aabb60e3b09f2f52dddb02f349f # frozen: 7.3.0
61- hooks :
62- - id : flake8
63- name : Check flake8 issues
64- files : ^src/package/|^tests/
65- types : [text, python]
66- additional_dependencies : [flake8-bugbear==25.11.29, flake8-builtins==3.1.0, flake8-comprehensions==3.17.0, flake8-docstrings==1.7.0, flake8-logging==1.8.0, flake8-mutable==1.2.0, flake8-noqa==1.4.0, flake8-print==5.0.0, flake8-pyi==25.5.0, flake8-pytest-style==2.2.0, flake8-rst-docstrings==0.4.0, pep8-naming==0.15.1]
67- args : [--config, .flake8]
30+ - id : ruff-check
31+ args : [--config, pyproject.toml, --fix, --exit-non-zero-on-fix]
6832
6933# Run Pylint from the local repo to make sure venv packages
7034# specified in pyproject.toml are available.
@@ -89,17 +53,6 @@ repos:
8953 types : [text, python]
9054 args : [--explicit-package-bases, --config-file, pyproject.toml]
9155
92- # Check for potential security issues.
93- - repo : https://github.com/PyCQA/bandit
94- rev : 92ae8b82fb422a639f0ed8d99e96cea769594e08 # frozen: 1.9.4
95- hooks :
96- - id : bandit
97- name : Check for security issues
98- args : [--configfile, pyproject.toml]
99- files : ^src/package/|^tests/
100- types : [text, python]
101- additional_dependencies : ['bandit[toml]']
102-
10356# Enable a whole bunch of useful helper hooks, too.
10457# See https://pre-commit.com/hooks.html for more hooks.
10558- repo : https://github.com/pre-commit/pre-commit-hooks
@@ -146,8 +99,6 @@ repos:
14699- repo : https://github.com/macisamuele/language-formatters-pre-commit-hooks
147100 rev : 4380fbb73a154b5f5624794c1c78d9719ccc860f # frozen: v2.16.0
148101 hooks :
149- - id : pretty-format-ini
150- args : [--autofix]
151102 - id : pretty-format-yaml
152103 args : [--autofix]
153104 # Commenting this out because https://github.com/pappasam/toml-sort/issues/11
0 commit comments