Enable TRY in flake8 and ruff
This commit is contained in:
parent
1827e02f34
commit
57ac602612
3 changed files with 25 additions and 0 deletions
|
|
@ -223,6 +223,7 @@ def lint_code(session: nox.Session) -> None:
|
||||||
"pep8-naming",
|
"pep8-naming",
|
||||||
"pydoclint[flake8]",
|
"pydoclint[flake8]",
|
||||||
"ruff",
|
"ruff",
|
||||||
|
"tryceratops",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Interpret extra arguments as `locations` of source files
|
# Interpret extra arguments as `locations` of source files
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ dev = [
|
||||||
"pep8-naming (>=0.15.1,<0.16.0)",
|
"pep8-naming (>=0.15.1,<0.16.0)",
|
||||||
"pydoclint[flake8] (>=0.12.0,<0.13.0)",
|
"pydoclint[flake8] (>=0.12.0,<0.13.0)",
|
||||||
"ruff (>=0.17.6,<0.18.0)",
|
"ruff (>=0.17.6,<0.18.0)",
|
||||||
|
"tryceratops (>=2.4.1,<3.0.0)",
|
||||||
]
|
]
|
||||||
|
|
||||||
test = [
|
test = [
|
||||||
|
|
@ -267,6 +268,8 @@ select = [
|
||||||
"N8",
|
"N8",
|
||||||
# pydoclint => Docstring matches implementation
|
# pydoclint => Docstring matches implementation
|
||||||
"DOC",
|
"DOC",
|
||||||
|
# tryceratops => Clean exception handling
|
||||||
|
"TRY",
|
||||||
# ========================================
|
# ========================================
|
||||||
# `ruff` only (no working `flake8` plugin)
|
# `ruff` only (no working `flake8` plugin)
|
||||||
# ========================================
|
# ========================================
|
||||||
|
|
@ -330,6 +333,8 @@ extend-ignore = [
|
||||||
"SIM901",
|
"SIM901",
|
||||||
# TODOs need neither an author nor an issue.
|
# TODOs need neither an author nor an issue.
|
||||||
"T002", "T003",
|
"T002", "T003",
|
||||||
|
# Messages are written where the exceptions are raised.
|
||||||
|
"TRY003",
|
||||||
]
|
]
|
||||||
|
|
||||||
per-file-ignores = [
|
per-file-ignores = [
|
||||||
|
|
@ -577,6 +582,8 @@ select = [
|
||||||
"TD",
|
"TD",
|
||||||
# flake8-tidy-imports ("I25") => No relative imports
|
# flake8-tidy-imports ("I25") => No relative imports
|
||||||
"TID",
|
"TID",
|
||||||
|
# tryceratops => Clean exception handling
|
||||||
|
"TRY",
|
||||||
# =======================================
|
# =======================================
|
||||||
# Violations not covered by `flake8` above
|
# Violations not covered by `flake8` above
|
||||||
# =======================================
|
# =======================================
|
||||||
|
|
@ -625,6 +632,8 @@ extend-ignore = [
|
||||||
"RUF100",
|
"RUF100",
|
||||||
# TODOs need neither an author nor an issue.
|
# TODOs need neither an author nor an issue.
|
||||||
"TD002", "TD003",
|
"TD002", "TD003",
|
||||||
|
# Messages are written where the exceptions are raised.
|
||||||
|
"TRY003",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
15
uv.lock
generated
15
uv.lock
generated
|
|
@ -3826,6 +3826,19 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/ad/66/0d785f0bc5e4315a96c989bb476d0fc07ea4f85132550c7b156ca2035d52/traitlets-5.16.1-py3-none-any.whl", hash = "sha256:f775618166caa0396c8e337099240f2bd3e5e917d203b2e6fbe21a58d3cb1f6b", size = 86211, upload-time = "2026-08-03T08:32:34.48Z" },
|
{ url = "https://files.pythonhosted.org/packages/ad/66/0d785f0bc5e4315a96c989bb476d0fc07ea4f85132550c7b156ca2035d52/traitlets-5.16.1-py3-none-any.whl", hash = "sha256:f775618166caa0396c8e337099240f2bd3e5e917d203b2e6fbe21a58d3cb1f6b", size = 86211, upload-time = "2026-08-03T08:32:34.48Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tryceratops"
|
||||||
|
version = "2.4.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "click" },
|
||||||
|
{ name = "rich" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/2a/d3/43c2c190bb6b01decc92d87538b451d7fe8070aaaf18aa1e166bf432754e/tryceratops-2.4.1.tar.gz", hash = "sha256:fbfc14650004e27cd1e55ebb7c76b43ced04a4d3b4cbe42aac9d71e4623ed84d", size = 20595, upload-time = "2024-10-30T16:42:40.97Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/27/b5/88caeba349f17b7fd37b61bc88f81c138b3b5149b4e2a9deec66eaad1bdb/tryceratops-2.4.1-py3-none-any.whl", hash = "sha256:271b92367be89b243918a56361618607d2a9aa4aa4ba766ecfabd5f98c00480c", size = 27378, upload-time = "2024-10-30T16:42:38.914Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typing-extensions"
|
name = "typing-extensions"
|
||||||
version = "4.16.0"
|
version = "4.16.0"
|
||||||
|
|
@ -3952,6 +3965,7 @@ dev = [
|
||||||
{ name = "pre-commit" },
|
{ name = "pre-commit" },
|
||||||
{ name = "pydoclint", extra = ["flake8"] },
|
{ name = "pydoclint", extra = ["flake8"] },
|
||||||
{ name = "ruff" },
|
{ name = "ruff" },
|
||||||
|
{ name = "tryceratops" },
|
||||||
]
|
]
|
||||||
docs = [
|
docs = [
|
||||||
{ name = "sphinx" },
|
{ name = "sphinx" },
|
||||||
|
|
@ -4030,6 +4044,7 @@ dev = [
|
||||||
{ name = "pre-commit", specifier = ">=4.7.0,<5.0.0" },
|
{ name = "pre-commit", specifier = ">=4.7.0,<5.0.0" },
|
||||||
{ name = "pydoclint", extras = ["flake8"], specifier = ">=0.12.0,<0.13.0" },
|
{ name = "pydoclint", extras = ["flake8"], specifier = ">=0.12.0,<0.13.0" },
|
||||||
{ name = "ruff", specifier = ">=0.17.6,<0.18.0" },
|
{ name = "ruff", specifier = ">=0.17.6,<0.18.0" },
|
||||||
|
{ name = "tryceratops", specifier = ">=2.4.1,<3.0.0" },
|
||||||
]
|
]
|
||||||
docs = [
|
docs = [
|
||||||
{ name = "sphinx", specifier = ">=9.2.0,<10.0.0" },
|
{ name = "sphinx", specifier = ">=9.2.0,<10.0.0" },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue