Skip to content

Commit a189635

Browse files
authored
chore: replace black with ruff, sync settings with Poetry repo and update ruff (#108)
1 parent 1796ad2 commit a189635

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ repos:
1818
- id: debug-statements
1919
- id: check-docstring-first
2020

21-
- repo: https://github.com/psf/black-pre-commit-mirror
22-
rev: 24.4.2
23-
hooks:
24-
- id: black
25-
2621
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.4.7
22+
rev: v0.5.4
2823
hooks:
2924
- id: ruff
25+
- id: ruff-format

pyproject.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ export = "poetry_plugin_bundle.plugin:BundleApplicationPlugin"
3636

3737
[tool.ruff]
3838
fix = true
39-
unfixable = [
40-
"ERA", # do not autoremove commented out code
41-
]
42-
target-version = "py38"
4339
line-length = 88
40+
src = ["src"]
41+
target-version = "py38"
42+
43+
[tool.ruff.lint]
4444
extend-select = [
4545
"B", # flake8-bugbear
4646
"C4", # flake8-comprehensions
@@ -51,30 +51,29 @@ extend-select = [
5151
"PGH", # pygrep
5252
"RUF", # ruff checks
5353
"SIM", # flake8-simplify
54+
"T20", # flake8-print
5455
"TCH", # flake8-type-checking
5556
"TID", # flake8-tidy-imports
5657
"UP", # pyupgrade
5758
]
58-
extend-exclude = [
59-
# External to the project's coding standards
60-
"tests/**/fixtures/*",
59+
extend-safe-fixes = [
60+
"TCH", # move import from and to TYPE_CHECKING blocks
61+
]
62+
unfixable = [
63+
"ERA", # do not autoremove commented out code
6164
]
6265

63-
[tool.ruff.flake8-tidy-imports]
66+
[tool.ruff.lint.flake8-tidy-imports]
6467
ban-relative-imports = "all"
6568

66-
[tool.ruff.isort]
69+
[tool.ruff.lint.isort]
6770
force-single-line = true
6871
lines-between-types = 1
6972
lines-after-imports = 2
7073
known-first-party = ["poetry_plugin_bundle"]
7174
required-imports = ["from __future__ import annotations"]
7275

7376

74-
[tool.black]
75-
target-version = ['py37']
76-
preview = true
77-
7877
[tool.mypy]
7978
enable_error_code = [
8079
"ignore-without-code",

src/poetry_plugin_bundle/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def commands(self) -> list[type[Command]]:
2424
def activate(self, application: Application) -> None:
2525
assert application.event_dispatcher
2626
application.event_dispatcher.add_listener(
27-
COMMAND, self.configure_bundle_commands # type: ignore[arg-type]
27+
COMMAND,
28+
self.configure_bundle_commands, # type: ignore[arg-type]
2829
)
2930
super().activate(application=application)
3031

0 commit comments

Comments
 (0)