Skip to content

Commit 7f9ce8a

Browse files
committed
Switch to ruff instead of flake8, isort, black.
1 parent f7105a5 commit 7f9ce8a

3 files changed

Lines changed: 34 additions & 27 deletions

File tree

.pre-commit-config.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ repos:
99
- id: check-docstring-first
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
12-
- repo: https://github.com/PyCQA/isort
13-
rev: 6.0.1
12+
- repo: https://github.com/PyCQA/docformatter
13+
rev: v1.7.7
1414
hooks:
15-
- id: isort
16-
additional_dependencies: [toml]
17-
- repo: https://github.com/asottile/pyupgrade
18-
rev: v3.20.0
15+
- id: docformatter
16+
args: [--in-place, --black]
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.12.4
1919
hooks:
20-
- id: pyupgrade
21-
args: [--py38-plus]
22-
- repo: https://github.com/psf/black-pre-commit-mirror
23-
rev: 25.1.0
20+
- id: ruff-format
21+
- id: ruff-check
22+
args: [ --fix ]
23+
- repo: https://github.com/codespell-project/codespell
24+
rev: v2.4.1
2425
hooks:
25-
- id: black
26-
- repo: https://github.com/PyCQA/flake8
27-
rev: 7.3.0
28-
hooks:
29-
- id: flake8
26+
- id: codespell
27+
# remove toml extra once Python 3.10 is no longer supported
28+
additional_dependencies: ['.[toml]']

pyproject.toml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ requires = [
3131
(platform_system != 'iOS' and platform_system != 'Android' and python_version < '3.14') \
3232
or (platform_system == 'iOS' and python_version < '3.14') \
3333
or (platform_system == 'Android' and python_version < '3.14')""",
34-
# pillow not available anywhere on 3.14. 11.3.0 wheel is known bad on iOS.
35-
"""pillow != 11.3.0; \
34+
# pillow not available anywhere on 3.14.
35+
"""pillow; \
3636
(platform_system != 'iOS' and platform_system != 'Android' and python_version < '3.14') \
3737
or (platform_system == 'iOS' and python_version < '3.14') \
3838
or (platform_system == 'Android' and python_version < '3.14')""",
@@ -108,7 +108,7 @@ flatpak_sdk = "org.gnome.Sdk"
108108

109109
[tool.briefcase.app.testbed.windows]
110110
requires = [
111-
# Python.net isn't avaialble for 3.14 yet.
111+
# Python.net isn't available for 3.14 yet.
112112
"pythonnet>=3.0.0; python_version < '3.14'",
113113
# Windows doesn't provide the zoneinfo TZ database; use the Python provided one
114114
"tzdata",
@@ -143,7 +143,20 @@ build_gradle_dependencies = [
143143

144144
# template = "../../templates/briefcase-android-gradle-template"
145145

146-
[tool.isort]
147-
profile = "black"
148-
split_on_trailing_comma = true
149-
combine_as_imports = true
146+
[tool.ruff.lint]
147+
# In addition to the default rules, these additional rules will be used:
148+
extend-select = [
149+
"E", # pycodestyle
150+
"W", # pycodestyle
151+
"F", # pyflakes
152+
"UP", # pyupgrade
153+
"B", # flake8-bugbear
154+
"YTT", # flake8-2020
155+
"ASYNC", # flake8-async
156+
"C4", # flake8-comprehensions
157+
"I", # isort
158+
# The SIM rules are *very* opinionated, and don't necessarily make for better code.
159+
# They may be worth occasionally turning on just to see if something could actually
160+
# use improvement.
161+
# "SIM", # flake8-simplify
162+
]

setup.cfg

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

0 commit comments

Comments
 (0)