Skip to content

Commit 400df31

Browse files
authored
chore: expand ruff usage (#54)
1 parent 330d22b commit 400df31

File tree

4 files changed

+22
-83
lines changed

4 files changed

+22
-83
lines changed

.flake8

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

.pre-commit-config.yaml

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

21-
- repo: https://github.com/pre-commit/pygrep-hooks
22-
rev: v1.10.0
23-
hooks:
24-
- id: python-check-mock-methods
25-
- id: python-use-type-annotations
26-
- id: python-check-blanket-noqa
27-
28-
- repo: https://github.com/asottile/pyupgrade
29-
rev: v3.4.0
30-
hooks:
31-
- id: pyupgrade
32-
args: [--py37-plus]
33-
34-
- repo: https://github.com/pycqa/isort
35-
rev: 5.12.0
36-
hooks:
37-
- id: isort
38-
name: isort (python)
39-
types: [python]
40-
args: [--add-import, from __future__ import annotations]
41-
- id: isort
42-
name: isort (pyi)
43-
types: [pyi]
44-
args: [--lines-after-imports, "-1"]
45-
4621
- repo: https://github.com/psf/black
4722
rev: 23.3.0
4823
hooks:
4924
- id: black
5025

5126
- repo: https://github.com/charliermarsh/ruff-pre-commit
52-
rev: v0.0.265
27+
rev: v0.0.267
5328
hooks:
54-
- id: ruff
29+
- id: ruff

pyproject.toml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,23 @@ export = "poetry_plugin_bundle.plugin:BundleApplicationPlugin"
3737
[tool.ruff]
3838
fix = true
3939
unfixable = [
40-
"ERA", # do not autoremove commented out code
40+
"ERA", # do not autoremove commented out code
4141
]
4242
target-version = "py37"
4343
line-length = 88
4444
extend-select = [
45-
"B", # flake8-bugbear
45+
"B", # flake8-bugbear
4646
"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
47+
"ERA", # flake8-eradicate/eradicate
48+
"I", # isort
49+
"N", # pep8-naming
50+
"PIE", # flake8-pie
51+
"PGH", # pygrep
52+
"RUF", # ruff checks
53+
"SIM", # flake8-simplify
54+
"TCH", # flake8-type-checking
55+
"TID", # flake8-tidy-imports
56+
"UP", # pyupgrade
5957
]
6058
extend-exclude = [
6159
# External to the project's coding standards
@@ -65,19 +63,18 @@ extend-exclude = [
6563
[tool.ruff.flake8-tidy-imports]
6664
ban-relative-imports = "all"
6765

66+
[tool.ruff.isort]
67+
force-single-line = true
68+
lines-between-types = 1
69+
lines-after-imports = 2
70+
known-first-party = ["poetry_plugin_bundle"]
71+
required-imports = ["from __future__ import annotations"]
72+
6873

6974
[tool.black]
7075
target-version = ['py37']
7176
preview = true
7277

73-
[tool.isort]
74-
py_version = 37
75-
profile = "black"
76-
force_single_line = true
77-
combine_as_imports = true
78-
lines_between_types = 1
79-
lines_after_imports = 2
80-
8178
[tool.mypy]
8279
enable_error_code = [
8380
"ignore-without-code",

src/poetry_plugin_bundle/bundlers/venv_bundler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _get_executable_info(self, executable: str) -> tuple[str, Version]:
240240
except CalledProcessError as e:
241241
from poetry.utils.env import EnvCommandError
242242

243-
raise EnvCommandError(e)
243+
raise EnvCommandError(e) from None
244244

245245
python_version = Version.parse(python_version_str.strip())
246246

0 commit comments

Comments
 (0)