Skip to content

Commit b852140

Browse files
Update pre-commit to use ruff
1 parent d50742d commit b852140

File tree

2 files changed

+16
-29
lines changed

2 files changed

+16
-29
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-toml
@@ -10,37 +10,24 @@ repos:
1010
- id: no-commit-to-branch
1111
args: [--branch, main]
1212
- id: trailing-whitespace
13-
- repo: https://github.com/PyCQA/isort
14-
rev: 5.13.2
15-
hooks:
16-
- id: isort
17-
name: isort
13+
1814
- repo: https://github.com/asottile/pyupgrade
19-
rev: v3.15.0
15+
rev: v3.16.0
2016
hooks:
2117
- id: pyupgrade
22-
args: [--py37-plus]
23-
- repo: https://github.com/psf/black
24-
rev: 24.1.1
25-
hooks:
26-
- id: black
27-
- id: black-jupyter
28-
- repo: https://github.com/PyCQA/pylint
29-
rev: v3.0.3
18+
args: [--py310-plus]
19+
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
rev: v0.4.8
3022
hooks:
31-
- id: pylint
32-
args: [--rcfile=.pylintrc]
33-
files: ^pymc_experimental/
23+
- id: ruff
24+
args: [ --fix, --exit-non-zero-on-fix ]
25+
- id: ruff-format
26+
types_or: [ python, pyi, jupyter ]
27+
3428
- repo: https://github.com/MarcoGorelli/madforhooks
3529
rev: 0.4.1
3630
hooks:
3731
- id: no-print-statements
3832
exclude: _version.py
3933
files: ^pymc_experimental/
40-
- repo: local
41-
hooks:
42-
- id: no-relative-imports
43-
name: No relative imports
44-
entry: from \.[\.\w]* import
45-
types: [python]
46-
language: pygrep

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ exclude_lines = [
3232
"if TYPE_CHECKING:",
3333
]
3434

35-
[tool.isort]
36-
profile = "black"
37-
# lines_between_types = 1
38-
3935
[tool.nbqa.mutate]
4036
isort = 1
4137
black = 1
4238
pyupgrade = 1
39+
40+
[tool.ruff.lint.per-file-ignores]
41+
'tests/*.py' = ['F841'] # Disable unused variable warning for test files
42+
'tests/statespace/*.py' = ['F401', 'F811'] # Disable unused import warning for test files; removes shared fixture imports

0 commit comments

Comments
 (0)