Skip to content

Commit 08549ae

Browse files
committed
Replace flake8, lint and black with ruff.
1 parent 9a1eed6 commit 08549ae

File tree

3 files changed

+38
-22
lines changed

3 files changed

+38
-22
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@ 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/astral-sh/ruff-pre-commit
13+
rev: v0.11.13
1414
hooks:
15-
- id: isort
16-
additional_dependencies: [toml]
17-
- repo: https://github.com/asottile/pyupgrade
18-
rev: v3.20.0
15+
- id: ruff-check
16+
args: [ --fix ]
17+
- id: ruff-format
18+
- repo: https://github.com/codespell-project/codespell
19+
rev: v2.4.1
1920
hooks:
20-
- id: pyupgrade
21-
args: [--py38-plus]
22-
- repo: https://github.com/psf/black-pre-commit-mirror
23-
rev: 25.1.0
24-
hooks:
25-
- id: black
26-
- repo: https://github.com/PyCQA/flake8
27-
rev: 7.3.0
28-
hooks:
29-
- id: flake8
21+
- id: codespell
22+
# remove toml extra once Python 3.10 is no longer supported
23+
additional_dependencies: ['.[toml]']

pyproject.toml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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",
@@ -147,3 +147,30 @@ build_gradle_dependencies = [
147147
profile = "black"
148148
split_on_trailing_comma = true
149149
combine_as_imports = true
150+
151+
# [tool.ruff]
152+
# exclude = [
153+
# ".template", # Ruff fails to run at all if allowed to lint the cookiecutter syntax
154+
# "core/src/toga/__init__.pyi"
155+
# ]
156+
157+
[tool.ruff.lint]
158+
# In addition to the default rules, these additional rules will be used:
159+
extend-select = [
160+
"E", # pycodestyle
161+
"W", # pycodestyle
162+
"F", # pyflakes
163+
"UP", # pyupgrade
164+
"B", # flake8-bugbear
165+
"YTT", # flake8-2020
166+
"ASYNC", # flake8-async
167+
"C4", # flake8-comprehensions
168+
"I", # isort
169+
# The SIM rules are *very* opinionated, and don't necessarily make for better code.
170+
# They may be worth occasionally turning on just to see if something could actually
171+
# use improvement.
172+
# "SIM", # flake8-simplify
173+
]
174+
175+
[tool.ruff.lint.isort]
176+
combine-as-imports = true

setup.cfg

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

0 commit comments

Comments
 (0)