Skip to content

Commit 692a54b

Browse files
Secrusradoering
authored andcommitted
Migrate from flake8 to ruff
1 parent 35714fc commit 692a54b

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,6 @@ repos:
2525
- id: python-use-type-annotations
2626
- id: python-check-blanket-noqa
2727

28-
- repo: https://github.com/asottile/yesqa
29-
rev: v1.4.0
30-
hooks:
31-
- id: yesqa
32-
additional_dependencies: &flake8_deps
33-
- flake8-annotations==3.0.0
34-
- flake8-broken-line==0.6.0
35-
- flake8-bugbear==23.2.13
36-
- flake8-comprehensions==3.10.1
37-
- flake8-eradicate==1.4.0
38-
- flake8-no-pep420==2.3.0
39-
- flake8-quotes==3.3.2
40-
- flake8-simplify==0.19.3
41-
- flake8-tidy-imports==4.8.0
42-
- flake8-type-checking==2.3.0
43-
- flake8-typing-imports==1.14.0
44-
- flake8-use-fstring==1.4
45-
- pep8-naming==0.13.3
46-
4728
- repo: https://github.com/asottile/pyupgrade
4829
rev: v3.3.1
4930
hooks:
@@ -67,8 +48,7 @@ repos:
6748
hooks:
6849
- id: black
6950

70-
- repo: https://github.com/pycqa/flake8
71-
rev: 5.0.4
51+
- repo: https://github.com/charliermarsh/ruff-pre-commit
52+
rev: v0.0.262
7253
hooks:
73-
- id: flake8
74-
additional_dependencies: *flake8_deps
54+
- id: ruff

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,39 @@ pytest-github-actions-annotate-failures = "^0.1.7"
3333
[tool.poetry.plugins."poetry.application.plugin"]
3434
export = "poetry_plugin_bundle.plugin:BundleApplicationPlugin"
3535

36+
37+
[tool.ruff]
38+
fix = true
39+
unfixable = [
40+
"ERA", # do not autoremove commented out code
41+
]
42+
target-version = "py37"
43+
line-length = 88
44+
extend-select = [
45+
"B", # flake8-bugbear
46+
"C4", # flake8-comprehensions
47+
"ERA", # flake8-eradicate/eradicate
48+
"PIE", # flake8-pie
49+
"SIM", # flake8-simplify
50+
"TID", # flake8-tidy-imports
51+
"TCH", # flake8-type-checking
52+
"N", # pep8-naming
53+
"RUF", # ruff checks
54+
]
55+
ignore = [
56+
"B904", # use 'raise ... from err'
57+
"B905", # use explicit 'strict=' parameter with 'zip()'
58+
"N818" # Exception name should be named with an Error suffix
59+
]
60+
extend-exclude = [
61+
# External to the project's coding standards
62+
"tests/**/fixtures/*",
63+
]
64+
65+
[tool.ruff.flake8-tidy-imports]
66+
ban-relative-imports = "all"
67+
68+
3669
[tool.black]
3770
target-version = ['py37']
3871
preview = true

src/poetry_plugin_bundle/console/commands/bundle/bundle_command.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def configure_bundler(self, bundler: Bundler) -> None:
3333
"""
3434
Configure the given bundler based on command specific options and arguments.
3535
"""
36-
pass
3736

3837
def handle(self) -> int:
3938
self.line("")

0 commit comments

Comments
 (0)