sloplintpy 0.2.0__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: sloplintpy
3
+ Version: 0.2.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Programming Language :: Rust
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Topic :: Software Development :: Quality Assurance
11
+ Summary: Fast, deterministic linter for AI 'slop' in Python — runs right after Ruff.
12
+ Keywords: linter,python,ruff,ai,slop,static-analysis
13
+ Author: sloplint contributors
14
+ License: MIT
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
17
+ Project-URL: Issues, https://github.com/galthran-wq/sloplint/issues
18
+ Project-URL: Repository, https://github.com/galthran-wq/sloplint
19
+
20
+ # sloplint
21
+
22
+ A fast, deterministic, **no-LLM** linter that counters AI slop in Python — a deliberately
23
+ nitpicking, opinionated layer that runs **right after [Ruff](https://docs.astral.sh/ruff/)**
24
+ in the same CI job. Ruff handles standard linting; sloplint adds the strict, slop-specific
25
+ judgments Ruff intentionally won't ship, and **never re-checks anything Ruff already covers**.
26
+
27
+ Written in Rust, reusing Ruff's own parser crates for a full-fidelity AST + token stream.
28
+
29
+ ## What it targets
30
+
31
+ Patterns that no mainstream linter flags today:
32
+
33
+ - Redundant "what" comments & docstrings that just restate the code (default: comments are
34
+ **banned**, configurable per-path).
35
+ - **Cross-file duplicated / near-duplicate functions** — copy-paste *and* "same logic,
36
+ slightly different" (the flagship clone engine).
37
+ - Redundant type hints, overly defensive `try/except`, verbose mechanical naming.
38
+ - ASCII-only enforcement (no emoji), deep-nesting caps, oversized files, flat-directory fanout.
39
+ - **Deeply nested data-structure literals** — a dict-of-lists-of-dicts inline blob past a
40
+ configurable depth, distinct from control-flow nesting (model it with a named type).
41
+ - Software-quality-metric **badges** + a per-PR summary, via a GitHub Action.
42
+
43
+ ## Installation
44
+
45
+ sloplint ships on PyPI as **`sloplintpy`** (the wheel bundles the native binary — no Rust
46
+ toolchain needed). The installed command is **`sloplint`**.
47
+
48
+ Run it directly with [uvx](https://docs.astral.sh/uv/) (the package and command differ, so use
49
+ `--from`):
50
+
51
+ ```bash
52
+ uvx --from sloplintpy sloplint check # Lint all files in the current directory.
53
+ uvx --from sloplintpy sloplint metrics # Report software-quality metrics.
54
+ ```
55
+
56
+ Or install `sloplintpy` with uv (recommended), pip, or pipx — then run `sloplint`:
57
+
58
+ ```bash
59
+ # With uv.
60
+ uv tool install sloplintpy@latest # Install the `sloplint` command globally.
61
+ uv add --dev sloplintpy # Or add it to your project.
62
+
63
+ # With pip.
64
+ pip install sloplintpy
65
+
66
+ # With pipx.
67
+ pipx install sloplintpy
68
+ ```
69
+
70
+ ## Usage
71
+
72
+ Once installed, `sloplint` is a native binary on your `PATH`:
73
+
74
+ ```bash
75
+ sloplint check path/to/code # lint (exit 1 on findings)
76
+ sloplint check src --format sarif # SARIF / json / github / text
77
+ sloplint metrics src # software-quality metrics table
78
+ sloplint metrics src --format github # PR-summary markdown (CC risk tiers)
79
+ sloplint metrics src --max-cyclomatic 10 # CI gate: exit 1 over McCabe's ceiling
80
+ sloplint metrics src --badges badges/ # emit SVG + shields-endpoint badges
81
+ sloplint parse file.py # dump AST + tokens (debug aid)
82
+ ```
83
+
84
+ From a clone, run it through cargo instead (`cargo run -p sloplint -- check path/to/code`), or
85
+ build a wheel locally with [maturin](https://www.maturin.rs/) (`maturin build --release`).
86
+
87
+ Comments are banned by default; relax per-path in `sloplint.toml`. Heuristic rules
88
+ (`SLP001/002/040/060/084/120`) are preview — enable with `--preview`. `SLP120` flags
89
+ low-cohesion "god classes" via LCOM4 (methods that split into unrelated groups;
90
+ thresholds `lcom4_max_components` / `lcom4_min_methods` under `[limits]`).
91
+
92
+ ## GitHub Action
93
+
94
+ Run sloplint on every PR — it uploads SARIF (inline annotations), posts a findings
95
+ summary comment, and can emit metric badges:
96
+
97
+ ```yaml
98
+ permissions:
99
+ contents: read
100
+ security-events: write
101
+ pull-requests: write
102
+ jobs:
103
+ sloplint:
104
+ runs-on: ubuntu-latest
105
+ steps:
106
+ - uses: actions/checkout@v4
107
+ - uses: galthran-wq/sloplint@main
108
+ with:
109
+ paths: src
110
+ badges-dir: .sloplint-badges # optional
111
+ ```
112
+
113
+ Intended to run **after** Ruff in the same job. See [`action.yml`](action.yml) for all inputs.
114
+
115
+ Required permissions: `security-events: write` (SARIF upload) and `pull-requests: write`
116
+ (PR comment) — both shown above. Without them the action degrades gracefully (it warns
117
+ rather than failing).
118
+
119
+ By default the action downloads a **prebuilt binary** for the runner (set `version:` to a
120
+ release tag like `v0.1.0`, or `latest`); if none is available it builds from source. Cut a
121
+ release to publish binaries:
122
+
123
+ ```bash
124
+ git tag v0.1.0 && git push origin v0.1.0 # triggers .github/workflows/release.yml
125
+ ```
126
+
127
+ ## Layout
128
+
129
+ | Crate | Role |
130
+ | --- | --- |
131
+ | `sloplint` | CLI binary |
132
+ | `sloplint_linter` | all rules + core run logic (cf. `ruff_linter`) |
133
+ | `sloplint_python` | parser seam over the pinned `ruff_*` crates |
134
+ | `sloplint_diagnostics` | rule-independent diagnostic model |
135
+ | `sloplint_clone` | near-duplicate function detection |
136
+ | `sloplint_metrics` | quality metrics + badges |
137
+ | `sloplint_report` | output formatters (text/JSON/SARIF/markdown) |
138
+ | `sloplint_dev` | development utilities (cf. `ruff_dev`) |
139
+
@@ -0,0 +1,5 @@
1
+ sloplintpy-0.2.0.data/scripts/sloplint.exe,sha256=aTKhI6QI3mRc0U0yRGZe461LgvexAze5LdVdoDE3EDc,4856320
2
+ sloplintpy-0.2.0.dist-info/METADATA,sha256=I9ropCW22F9itK8pKoYB4Mxzmbw6ASMG7o2aLi73XC8,5623
3
+ sloplintpy-0.2.0.dist-info/WHEEL,sha256=2zDlIYIdD4m4N3p5DVEG3iJhGLdhsBQgdH-FqVkAur8,94
4
+ sloplintpy-0.2.0.dist-info/sboms/sloplint.cyclonedx.json,sha256=gE1A77PO2hdOnVP-3qNyHFjRP20OkhxNv5b6ljSVdP8,124316
5
+ sloplintpy-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.14.1)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64