Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 548529f

Browse files
committed
build: transition to ruff for linting and formatting
1 parent 04c9686 commit 548529f

3 files changed

Lines changed: 33 additions & 86 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
default_stages: [pre-commit]
22

33
repos:
4-
- repo: local
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.12.1
56
hooks:
6-
- id: black
7-
name: black
8-
entry: black
9-
language: system
10-
types: [python]
11-
12-
- repo: local
13-
hooks:
14-
- id: flake8
15-
name: flake8
16-
entry: flake8
17-
language: system
18-
types: [python]
7+
- id: ruff-check
8+
- id: ruff-format
199

2010
- repo: local
2111
hooks:
@@ -25,14 +15,6 @@ repos:
2515
language: system
2616
stages: [commit-msg]
2717

28-
- repo: local
29-
hooks:
30-
- id: isort
31-
name: isort
32-
entry: isort
33-
language: system
34-
types: [python]
35-
3618
- repo: local
3719
hooks:
3820
- id: pyright

pyproject.toml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,11 @@ pytest-cov = "^6.0.0"
1818
tox = "^4.0.0"
1919

2020
[tool.poetry.group.lint.dependencies]
21-
black = "^24.0.0"
21+
ruff = "==0.12.1"
2222
commitizen = "^3.0.0"
23-
darglint = "^1.8.1"
24-
flake8 = "^7.0.0"
25-
flake8-alphabetize = "^0.0.19"
26-
flake8-bugbear = "^24.0.0"
27-
flake8-comprehensions = "^3.10.0"
28-
flake8-docstrings = "^1.5.0"
29-
flake8-pytest-style = "^2.0.0"
30-
flake8-use-fstring = "^1.1"
3123
"github3.py" = "^4.0.0"
32-
isort = "^5.10.1"
33-
mccabe = "^0.7.0"
3424
pre-commit = "^4.0.0"
35-
pyright = "^1.1.267"
25+
pyright = "==1.1.402"
3626

3727
[tool.poetry.group.docs.dependencies]
3828
furo = "*"
@@ -55,9 +45,6 @@ bump_pattern = '^(build|deprecate|feat|fix|perf)'
5545
bump_map = { feat = "MINOR", build = "PATCH", deprecate = "PATCH", fix = "PATCH", perf = "PATCH" }
5646
schema_pattern = '(build|ci|deprecate|docs|feat|fix|perf|refactor|release|style|test)(\(\w+\))?!?:\s\S.*'
5747

58-
[tool.isort]
59-
profile = 'black'
60-
6148
[tool.pytest.ini_options]
6249
log_cli_level = 10
6350
addopts = "--color=yes"
@@ -74,6 +61,33 @@ exclude = [
7461
]
7562
pythonPlatform = "All"
7663

64+
[tool.ruff.lint]
65+
select = ["ALL"]
66+
ignore = [
67+
"COM", # the formatter handles trailing commas
68+
"G004", # use f strings in logging for a consistent string format
69+
"PYI056", # use extend on __all__
70+
"RET501", # don't care about return None semantics
71+
"RET502", # don't care about return None semantics
72+
"RET503", # don't care about return None semantics
73+
]
74+
75+
[tool.ruff.lint.per-file-ignores]
76+
"docs/conf.py" = [
77+
"INP001", # docs directory isn't a python package
78+
]
79+
"tests/*" = [
80+
"ANN", # tests don't need type annotations
81+
"ARG", # arguments in pytest are fixtures
82+
"C90", # tests are as complex as they need to be
83+
"INP001", # tests don't need __init__
84+
"RET", # tests don't need returns
85+
"S", # asserts used in tests
86+
]
87+
88+
[tool.ruff.lint.pydocstyle]
89+
convention = "google"
90+
7791
[build-system]
7892
requires = ["poetry-core>=1.0"]
7993
build-backend = "poetry.core.masonry.api"

setup.cfg

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)