From db1e18591333fa72c30fac3b7dfc7ef175612578 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 15 Mar 2023 14:42:11 -0400 Subject: flake8 -> ruff, a mostly painless affair. --- pyproject.toml | 53 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 11 deletions(-) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index f709c9f..859ff71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,15 +111,46 @@ multi_line_output = 3 ignore_missing_imports = true show_error_codes = true -[tool.pydocstyle] -match = "(?!(test_|_|compat|cli)).*\\.py" # see PyCQA/pydocstyle#323 -add-select = [ - "D410", # Trailing whitespace plz -] -add-ignore = [ - "D107", # Hah, no - "D200", # 1-line docstrings don't need to be on one line - "D202", # One line is fine. - "D412", # Trailing whitespace plz - "D413", # No trailing whitespace plz +[tool.ruff] +line-length = 79 +target-version = "py38" +select = ["B", "D", "D204", "E", "F", "Q", "UP", "W"] +ignore = [ + # It's totally OK to call functions for default arguments. + "B008", + # raise SomeException(...) is fine. + "B904", + # It's fine to not have docstrings for magic methods. + "D105", + # __init__ especially doesn't need a docstring + "D107", + # This rule makes diffs uglier when expanding docstrings (and it's uglier) + "D200", + # No blank lines before docstrings. + "D203", + # Start docstrings on the second line. + "D212", + # This rule misses sassy docstrings ending with ! or ?. + "D400", + # Section headers should end with a colon not a newline + "D406", + # Underlines aren't needed + "D407", + # Plz spaces after section headers + "D412", ] +extend-exclude = ["json"] + +[tool.ruff.flake8-quotes] +docstring-quotes = "double" + +[tool.ruff.per-file-ignores] +"docs/*" = ["D"] +"jsonschema/cli.py" = ["D", "UP"] +"jsonschema/_utils.py" = ["D"] +"jsonschema/benchmarks/*" = ["D"] +"jsonschema/tests/*" = ["D"] + +[tool.ruff.pyupgrade] +# We support 3.8 + 3.9 +keep-runtime-typing = true -- cgit v1.2.1