Skip to content

Commit 80f5d81

Browse files
authored
chore: expand ruff usage (#201)
1 parent e63900f commit 80f5d81

File tree

2 files changed

+23
-50
lines changed

2 files changed

+23
-50
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,6 @@ repos:
1919
- id: debug-statements
2020
- id: check-docstring-first
2121

22-
- repo: https://github.com/pre-commit/pygrep-hooks
23-
rev: v1.10.0
24-
hooks:
25-
- id: python-check-mock-methods
26-
- id: python-use-type-annotations
27-
- id: python-check-blanket-noqa
28-
29-
- repo: https://github.com/asottile/pyupgrade
30-
rev: v3.4.0
31-
hooks:
32-
- id: pyupgrade
33-
args: [--py37-plus]
34-
35-
- repo: https://github.com/pycqa/isort
36-
rev: 5.12.0
37-
hooks:
38-
- id: isort
39-
name: "isort (python)"
40-
types: [python]
41-
args: [--add-import, from __future__ import annotations]
42-
43-
- id: isort
44-
name: "isort (pyi)"
45-
types: [pyi]
46-
args: [--lines-after-imports, "-1"]
47-
4822
- repo: https://github.com/psf/black
4923
rev: 23.3.0
5024
hooks:
@@ -53,4 +27,4 @@ repos:
5327
- repo: https://github.com/charliermarsh/ruff-pre-commit
5428
rev: v0.0.265
5529
hooks:
56-
- id: ruff
30+
- id: ruff

pyproject.toml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,46 +43,45 @@ export = "poetry_plugin_export.plugins:ExportApplicationPlugin"
4343
[tool.ruff]
4444
fix = true
4545
unfixable = [
46-
"ERA", # do not autoremove commented out code
46+
"ERA", # do not autoremove commented out code
4747
]
4848
target-version = "py37"
4949
line-length = 88
5050
extend-select = [
51-
"B", # flake8-bugbear
51+
"B", # flake8-bugbear
5252
"C4", # flake8-comprehensions
53-
"ERA", # flake8-eradicate/eradicate
54-
"PIE", # flake8-pie
55-
"SIM", # flake8-simplify
56-
"TID", # flake8-tidy-imports
57-
"TCH", # flake8-type-checking
58-
"N", # pep8-naming
59-
"RUF", # ruff checks
60-
]
61-
ignore = [
62-
"B904", # use 'raise ... from err'
63-
"B905", # use explicit 'strict=' parameter with 'zip()'
64-
"N818" # Exception name should be named with an Error suffix
53+
"ERA", # flake8-eradicate/eradicate
54+
"I", # isort
55+
"N", # pep8-naming
56+
"PIE", # flake8-pie
57+
"PGH", # pygrep
58+
"RUF", # ruff checks
59+
"SIM", # flake8-simplify
60+
"TCH", # flake8-type-checking
61+
"TID", # flake8-tidy-imports
62+
"UP", # pyupgrade
6563
]
6664
extend-exclude = [
6765
"docs/*",
6866
# External to the project's coding standards
6967
"tests/**/fixtures/*",
7068
]
7169

70+
[tool.ruff.flake8-tidy-imports]
71+
ban-relative-imports = "all"
72+
73+
[tool.ruff.isort]
74+
force-single-line = true
75+
lines-between-types = 1
76+
lines-after-imports = 2
77+
known-first-party = ["poetry_plugin_export"]
78+
required-imports = ["from __future__ import annotations"]
79+
7280

7381
[tool.black]
7482
target-version = ['py37']
7583
preview = true
7684

77-
[tool.isort]
78-
profile = "black"
79-
force_single_line = true
80-
atomic = true
81-
include_trailing_comma = true
82-
lines_after_imports = 2
83-
lines_between_types = 1
84-
use_parentheses = true
85-
8685
[tool.mypy]
8786
namespace_packages = true
8887
show_error_codes = true

0 commit comments

Comments
 (0)