Skip to content

Commit 544fc6d

Browse files
committed
redo with some laxer rules
1 parent 149276f commit 544fc6d

File tree

4 files changed

+22
-42
lines changed

4 files changed

+22
-42
lines changed

pyproject.toml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ exclude_lines = [
105105
[tool.ruff]
106106
src = ["src", "tests"]
107107
line-length = 100
108+
exclude = [
109+
"bin",
110+
"sbin",
111+
"docs",
112+
]
108113

109114
[tool.ruff.lint]
110115
select = [
@@ -143,43 +148,13 @@ select = [
143148
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
144149
"PLC", # https://docs.astral.sh/ruff/rules/#convention-c
145150
"PLE", # https://docs.astral.sh/ruff/rules/#error-e_1
151+
"PLR", # https://docs.astral.sh/ruff/rules/#refactor-plr
146152
"PLW", # https://docs.astral.sh/ruff/rules/#warning-plw
147153
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
148154
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
149155
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
150156
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
151157
]
152-
fixable = [
153-
"ANN",
154-
"ASYNC",
155-
"B",
156-
"C4",
157-
"ISC",
158-
"ICN",
159-
"LOG",
160-
"G",
161-
"PIE",
162-
"PT",
163-
"RSE",
164-
"RET",
165-
"SIM",
166-
"TID",
167-
"PTH",
168-
"I",
169-
"N",
170-
"PERF",
171-
"D",
172-
"F401",
173-
"F541",
174-
"PGH",
175-
"PLC",
176-
"PLE",
177-
"PLW",
178-
"UP",
179-
"FURB",
180-
"RUF",
181-
"TRY"
182-
]
183158
ignore = [
184159
# ignore for compatibility with formatter
185160
"D206",
@@ -192,17 +167,24 @@ ignore = [
192167
"W191",
193168
"S321",
194169
"COM812",
195-
# other
170+
# don't require types on *args, **kwargs
196171
"ANN002",
197172
"ANN003",
198-
"PLR0913",
199-
"PLC0206",
200-
"D213",
173+
# subjective pylint thresholds
174+
"PLR0904",
175+
"PLR091",
176+
"PLR1702",
177+
# excessive docstring requirements
178+
"D105",
179+
"D205",
201180
"D203",
181+
"D213", # conflicts with D212
202182
"D400",
183+
"D401",
203184
"D415",
185+
# excessive exception message requirements
204186
"TRY003",
205-
"B019",
187+
# excessive type ignore requirements
206188
"PGH003",
207189
]
208190

src/biocommons/example/marvin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
def is_alive() -> bool:
21-
"""Test whether Marvin is alive
21+
"""Tests whether Marvin is alive
2222
2323
>>> is_alive() is True
2424
True
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Declare tests internal to src directory"""
1+
# noqa: D104
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
"""Provide fixtures to tests."""
2-
1+
# noqa: D100
32
import importlib.resources
43

54
import pytest
65
import yaml
76

87

98
@pytest.fixture
10-
def all_quotes() -> None:
11-
"""Provide quotes fixture"""
9+
def all_quotes() -> dict: # noqa: D103
1210
quotes_stream = importlib.resources.files("example").joinpath("quotes.yaml").read_text()
1311
return yaml.load(quotes_stream, Loader=yaml.SafeLoader)["quotes"]

0 commit comments

Comments
 (0)