Skip to content

Commit 03ec8d2

Browse files
committed
Enable the rest of the rulesets we care about.
1 parent a17cd37 commit 03ec8d2

File tree

1 file changed

+54
-35
lines changed

1 file changed

+54
-35
lines changed

pyproject.toml

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ name = "jsonschema"
1010
description = "An implementation of JSON Schema validation for Python"
1111
license = {text = "MIT"}
1212
requires-python = ">=3.8"
13-
keywords = ["validation", "data validation", "jsonschema", "json"]
13+
keywords = [
14+
"validation",
15+
"data validation",
16+
"jsonschema",
17+
"json",
18+
"json schema",
19+
]
1420
authors = [
1521
{email = "[email protected]"},
1622
{name = "Julian Berman"},
@@ -32,7 +38,6 @@ classifiers = [
3238
"Topic :: File Formats :: JSON :: JSON Schema",
3339
]
3440
dynamic = ["version", "readme"]
35-
3641
dependencies = [
3742
"attrs>=22.2.0",
3843
"jsonschema-specifications>=2023.03.6",
@@ -125,6 +130,7 @@ skip_covered = true
125130

126131
[tool.doc8]
127132
ignore = [
133+
"D000", # see PyCQA/doc8#125
128134
"D001", # one sentence per line, so max length doesn't make sense
129135
]
130136

@@ -143,45 +149,58 @@ exclude = ["jsonschema/benchmarks/*"]
143149
line-length = 79
144150
select = ["B", "D", "D204", "E", "F", "Q", "RUF", "SIM", "TCH", "UP", "W"]
145151
ignore = [
146-
# Wat, type annotations for self and cls, why is this a thing?
147-
"ANN101",
148-
"ANN102",
149-
# Private annotations are fine to leave out.
150-
"ANN202",
151-
# It's totally OK to call functions for default arguments.
152-
"B008",
153-
# raise SomeException(...) is fine.
154-
"B904",
155-
# There's no need for explicit strict, this is simply zip's default behavior.
156-
"B905",
157-
# It's fine to not have docstrings for magic methods.
158-
"D105",
159-
# __init__ especially doesn't need a docstring
160-
"D107",
161-
# This rule makes diffs uglier when expanding docstrings (and it's uglier)
162-
"D200",
163-
# No blank lines before docstrings.
164-
"D203",
165-
# Start docstrings on the second line.
166-
"D212",
167-
# This rule misses sassy docstrings ending with ! or ?.
168-
"D400",
169-
# Section headers should end with a colon not a newline
170-
"D406",
171-
# Underlines aren't needed
172-
"D407",
173-
# Plz spaces after section headers
174-
"D412",
175-
# Not sure what heuristic this uses, but it seems easy for it to be wrong.
176-
"SIM300",
177-
# We support 3.8 + 3.9
178-
"UP007",
152+
"A001", # It's fine to shadow builtins
153+
"A002",
154+
"A003",
155+
"ARG", # This is all wrong whenever an interface is involved
156+
"ANN", # Just let the type checker do this
157+
"B006", # Mutable arguments require care but are OK if you don't abuse them
158+
"B008", # It's totally OK to call functions for default arguments.
159+
"B904", # raise SomeException(...) is fine.
160+
"B905", # No need for explicit strict, this is simply zip's default behavior
161+
"C408", # Calling dict is fine when it saves quoting the keys
162+
"C901", # Not really something to focus on
163+
"D105", # It's fine to not have docstrings for magic methods.
164+
"D107", # __init__ especially doesn't need a docstring
165+
"D200", # This rule makes diffs uglier when expanding docstrings
166+
"D203", # No blank lines before docstrings.
167+
"D212", # Start docstrings on the second line.
168+
"D400", # This rule misses sassy docstrings ending with ! or ?
169+
"D401", # This rule is too flaky.
170+
"D406", # Section headers should end with a colon not a newline
171+
"D407", # Underlines aren't needed
172+
"D412", # Plz spaces after section headers
173+
"EM101", # These don't bother me.
174+
"EM102",
175+
"FBT", # It's worth avoiding boolean args but I don't care to enforce it
176+
"FIX", # Yes thanks, if I could it wouldn't be there
177+
"N", # These naming rules are silly
178+
"PLR0912", # These metrics are fine to be aware of but not to enforce
179+
"PLR0913",
180+
"PLR0915",
181+
"PLW2901", # Shadowing for loop variables is occasionally fine.
182+
"PT006", # pytest parametrize takes strings as well
183+
"RET503", # Returning None implicitly is fine
184+
"RET505", # These push you to use `if` instead of `elif`, but for no reason
185+
"RET506",
186+
"RSE102", # Ha, what, who even knew you could leave the parens off. But no.
187+
"SIM300", # Not sure what heuristic this uses, but it's easily incorrect
188+
"SLF001", # Private usage within this package itself is fine
189+
"TD", # These TODO style rules are also silly
190+
"TRY003", # Some exception classes are essentially intended for free-form
179191
]
180192
extend-exclude = ["json"]
181193

194+
[tool.ruff.lint.flake8-pytest-style]
195+
mark-parentheses = false
196+
182197
[tool.ruff.flake8-quotes]
183198
docstring-quotes = "double"
184199

200+
[tool.ruff.lint.isort]
201+
combine-as-imports = true
202+
from-first = true
203+
185204
[tool.ruff.per-file-ignores]
186205
"noxfile.py" = ["ANN", "D100"]
187206
"docs/*" = ["ANN", "D"]

0 commit comments

Comments
 (0)