Metadata-Version: 2.4
Name: pyunslop
Version: 0.0.2
Summary: Warning-only Python code checks for humans and coding agents
License: MIT License
        
        Copyright (c) 2026 pyunslop contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: lint,comments,agents,python
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: pytest-mock>=3.14; extra == "test"
Dynamic: license-file

<div align="center">

<img src="https://raw.githubusercontent.com/xLongLink/pyunslop/main/banner.png" alt="pyunslop banner" />

<h3>Keep Python code clear, for humans and coding agents</h3>


[![Tests](https://github.com/xLongLink/pyunslop/actions/workflows/tests.yml/badge.svg)](https://github.com/xLongLink/pyunslop/actions/workflows/tests.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/pyunslop)](https://pypi.org/project/pyunslop/)

</div>

<br />

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
```


<br />

## Rules

| Code | Warning |
| --- | --- |
| [SLOP001](docs/SLOP001.md) | More than 10 complexity points without a standalone comment. |
| [SLOP002](docs/SLOP002.md) | Missing blank line before a standalone comment block. |
| [SLOP003](docs/SLOP003.md) | Forbidden `noqa` suppression directive in a comment. |
| [SLOP004](docs/SLOP004.md) | Name asynchronous SQLAlchemy/SQLModel query results before consuming them. |
| [SLOP005](docs/SLOP005.md) | Use `Sequence[T]` for read-only query-result return types. |
| [SLOP006](docs/SLOP006.md) | Avoid redundant `list(result.all())` copies when a sequence is sufficient. |
| [SLOP007](docs/SLOP007.md) | Iterate buffered query results directly instead of iterating `result.all()`. |
| [SLOP008](docs/SLOP008.md) | Pass generators rather than single-use list comprehensions to SQLAlchemy `.in_()`. |
| [SLOP009](docs/SLOP009.md) | Name allowlisted domain-class instances before calling their methods. |
| [SLOP010](docs/SLOP010.md) | Declare FastAPI JSON endpoint response schemas explicitly. |
| [SLOP011](docs/SLOP011.md) | Return API payloads directly instead of generic success envelopes. |
| [SLOP012](docs/SLOP012.md) | Reject leading module docstrings (CLI help exempt). |
| [SLOP013](docs/SLOP013.md) | Replace single literal-case pytest parametrization when it adds no fixture/collection behavior. |
| [SLOP014](docs/SLOP014.md) | Order Pydantic model fields from shortest name to longest within each section. |
| [SLOP015](docs/SLOP015.md) | Review response-model reconstruction when the route already declares that model. |
| [SLOP016](docs/SLOP016.md) | Use an explicit loop for dependent walrus bindings in comprehension constructor arguments. |
| [SLOP017](docs/SLOP017.md) | Review single-use list materialization for known iterable-only consumers. |
| [SLOP018](docs/SLOP018.md) | Prefer scalar query APIs for scalar-result consumption, preserving cardinality checks. |
| [SLOP019](docs/SLOP019.md) | Review rows loaded solely to check size, existence, or a threshold. |
| [SLOP020](docs/SLOP020.md) | Review transparent forwarding wrappers and subclasses with no added behavior. |
| [SLOP021](docs/SLOP021.md) | Review classes that only store and use a borrowed client. |
| [SLOP022](docs/SLOP022.md) | Review immediate post-commit ORM refreshes. |
| [SLOP023](docs/SLOP023.md) | Review inlining single-use literal constants. |

<br />

## Suggested Ruff configurations

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.
Comment spacing is delegated to Ruff's E262/E265, and direct list comprehensions
passed to `sum`, `min`, `max`, or `set` to C419/C403. Preview mode is required
for the comment checks and C419's `sum`/`min`/`max` coverage.

```toml
[tool.ruff]
line-length = 140
target-version = "py310"

[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", "S324", "S506", "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

[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["visit_*"]
```

<br />

---

<div align="center">
LongLink 2026

[License](./LICENSE) &nbsp; - &nbsp; [Contributing](./CONTRIBUTING.md) &nbsp; - &nbsp; [Code of Conduct](./CODE_OF_CONDUCT.md) &nbsp; - &nbsp; [Contact](mailto:info@longlink.dev)

</div>

---
