Skip to content

Commit e5b59f9

Browse files
committed
Update ruff config
1 parent 63707ac commit e5b59f9

File tree

2 files changed

+49
-16
lines changed

2 files changed

+49
-16
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ repos:
2323
files: \.(html|md|yml|yaml|toml)
2424
args: [--prose-wrap=preserve]
2525

26-
- repo: https://github.com/psf/black
27-
rev: 3702ba224ecffbcec30af640c149f231d90aebdb # frozen: 24.4.2
28-
hooks:
29-
- id: black
30-
3126
- repo: https://github.com/astral-sh/ruff-pre-commit
3227
rev: 1dc9eb131c2ea4816c708e4d85820d2cc8542683 # frozen: v0.5.0
3328
hooks:
3429
- id: ruff
35-
args: [--fix, --exit-non-zero-on-fix]
30+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
31+
- id: ruff-format

pyproject.toml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,56 @@ ignored_user_logins = ["dependabot[bot]", "pre-commit-ci[bot]", "web-flow"]
4141
attr = 'lazy_loader.__version__'
4242

4343
[tool.ruff]
44-
line-length = 88
4544
exclude = [
4645
"lazy_loader/tests/fake_pkg/__init__.pyi",
4746
]
4847

48+
#[tool.ruff.lint]
49+
#select = [
50+
# "C",
51+
# "E",
52+
# "F",
53+
# "W",
54+
# "B",
55+
# "I",
56+
# "UP",
57+
#]
58+
#ignore = ["B018", "B028"]
4959
[tool.ruff.lint]
50-
select = [
51-
"C",
52-
"E",
53-
"F",
54-
"W",
55-
"B",
56-
"I",
57-
"UP",
60+
extend-select = [
61+
"B", # flake8-bugbear
62+
"I", # isort
63+
"ARG", # flake8-unused-arguments
64+
"C4", # flake8-comprehensions
65+
"EM", # flake8-errmsg
66+
"ICN", # flake8-import-conventions
67+
"G", # flake8-logging-format
68+
"PGH", # pygrep-hooks
69+
"PIE", # flake8-pie
70+
"PL", # pylint
71+
"PT", # flake8-pytest-style
72+
# "PTH", # flake8-use-pathlib
73+
"RET", # flake8-return
74+
"RUF", # Ruff-specific
75+
"SIM", # flake8-simplify
76+
"T20", # flake8-print
77+
"UP", # pyupgrade
78+
"YTT", # flake8-2020
79+
"EXE", # flake8-executable
80+
"NPY", # NumPy specific rules
81+
"PD", # pandas-vet
82+
"FURB", # refurb
83+
"PYI", # flake8-pyi
84+
]
85+
ignore = [
86+
"PLR09", # Too many <...>
87+
"PLR2004", # Magic value used in comparison
88+
"ISC001", # Conflicts with formatter
89+
"B018", # Found useless expression
90+
"B028", # No explicit `stacklevel` keyword argument found
91+
"PT011", # `pytest.raises(ValueError)` is too broad
92+
"EM102", # Exception must not use an f-string literal
93+
"EM101", # Exception must not use a string literal
94+
"RET505", # Unnecessary `elif` after `return` statement
95+
"SIM108", # Use ternary operator
5896
]
59-
ignore = ["B018", "B028"]

0 commit comments

Comments
 (0)