Run to flag the issues, ask you agent to fix them:
uvx pyunslop
Add to you AGENTS.md file:
DO run `uvx pyunslop` and fix any warnings
| Code | Warning |
|---|---|
| SLOP001 | More than 10 complexity points without a standalone comment. |
| SLOP002 | Missing blank line before a standalone comment block. |
| SLOP003 | Forbidden noqa suppression directive in a comment. |
| SLOP004 | Name asynchronous SQLAlchemy/SQLModel query results before consuming them. |
| SLOP005 | Use Sequence[T] for read-only query-result return types. |
| SLOP006 | Avoid redundant list(result.all()) copies when a sequence is sufficient. |
| SLOP007 | Iterate buffered query results directly instead of iterating result.all(). |
| SLOP008 | Pass generators rather than single-use list comprehensions to SQLAlchemy .in_(). |
| SLOP009 | Name allowlisted domain-class instances before calling their methods. |
| SLOP010 | Declare FastAPI JSON endpoint response schemas explicitly. |
| SLOP011 | Return API payloads directly instead of generic success envelopes. |
| SLOP012 | Reject leading module docstrings (CLI help and Alembic revision headers exempt). |
| SLOP013 | Replace single literal-case pytest parametrization when it adds no fixture/collection behavior. |
| SLOP014 | Order Pydantic model fields from shortest name to longest within each section. |
| SLOP015 | Review response-model reconstruction when the route already declares that model. |
| SLOP016 | Use an explicit loop for dependent walrus bindings in comprehension constructor arguments. |
| SLOP017 | Review single-use list materialization for known iterable-only consumers. |
| SLOP018 | Prefer scalar query APIs for scalar-result consumption, preserving cardinality checks. |
| SLOP019 | Review rows loaded solely to check size, existence, or a threshold. |
| SLOP020 | Review transparent forwarding wrappers and subclasses with no added behavior. |
| SLOP021 | Review classes that only store and use a borrowed client. |
| SLOP022 | Review immediate post-commit ORM refreshes. |
| SLOP023 | Review inlining single-use literal constants. |
The rules complement an exising ruff configuration, this is our suggestion:
Install Ruff separately and add these settings to your pyproject.toml.
Run ruff check and ruff format --check separately; pyunslop does not run Ruff.
[tool.ruff]
line-length = 140
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint]
preview = true
select = [
"F", "UP", "D", "DTZ", "I", "ICN", "PIE", "RET", "ARG", "N",
"PERF", "PTH", "A", "S", "ASYNC", "ANN", "B006", "E302", "E305",
"E262", "E265", "C403", "C419",
"PGH003", "PT", "RUF100", "TID252",
]
ignore = ["D100", "D104", "D202"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["ARG", "N803", "S"]
[tool.ruff.lint.isort]
no-sections = true
length-sort = true
split-on-trailing-comma = false
LongLink 2026
