How tinyfrontier/anti-slop-py works
anti-slop-py is a zero-dependency Python linter for syntactic patterns that weaken type evidence. Its main workflow is: the CLI loads configuration and selects files (optionally by diff), the engine runs enabled rules over each file, and findings are filtered or formatted for output. The graph also preserves the documented baseline, SARIF, review, presets, and opt-in FastAPI capabilities. Exact orchestration beyond the sampled excerpts is based on README documentation; uncertain internal calls are omitted.
Main entry points: __main__.py CLI entry · runner.py Rule runner · config.py Config and presets · diff.py Diff selection
Components 22
CLI interface
- CLI entry
src/anti_slop/__main__.py
Analysis engine
- Config and presets
src/anti_slop/engine/config.py - Diff selection
src/anti_slop/engine/diff.py - File walking
src/anti_slop/engine/walker.py - Lexical scopes
src/anti_slop/engine/scopes.py - Rule context
src/anti_slop/engine/context.py - Comment suppressions
src/anti_slop/engine/comments.py - Rule runner
src/anti_slop/engine/runner.py
Rule sets
- Core registry
src/anti_slop/__init__.py - Core rules
src/anti_slop/rules - Annotation analysis
src/anti_slop/rules/_annotations.py - FastAPI rules
src/anti_slop/contrib/fastapi
Findings and review
- Findings baseline
src/anti_slop/engine/baseline.py - Finding fingerprints
src/anti_slop/engine/fingerprint.py - Change review
src/anti_slop/engine/review.py - SARIF output
src/anti_slop/engine/sarif.py - Diagnostics
src/anti_slop/engine/rule.py
Other components
- Developer
- Python source
- Project config
- Git diff
- Lint result
Connections 28
- Developer → CLI entry: invokes
- Python source → CLI entry: selects paths
- Project config → Config and presets: configures
- CLI entry → Config and presets: loads
- CLI entry → Diff selection: requests changed lines
- Git diff → Diff selection: provides changes
- CLI entry → File walking: selects targets
- Diff selection → CLI entry: limits scan
- CLI entry → Rule runner: runs checks
- File walking → Rule runner: provides files
- Core registry → Rule runner: supplies rules
- Config and presets → Rule runner: sets enabled rules
- Rule runner → Lexical scopes: builds per-file scopes
- Rule runner → Rule context: creates context
- Rule context → Comment suppressions: checks suppressions
- Rule runner → Core rules: dispatches rules
- Core rules → Annotation analysis: uses
- Config and presets → FastAPI rules: enables optionally
- Rule runner → FastAPI rules: dispatches when enabled
- Core rules → Diagnostics: reports findings
- FastAPI rules → Diagnostics: reports findings
- Rule runner → Findings baseline: filters findings
- Rule runner → Finding fingerprints: fingerprints findings
- CLI entry → Change review: composes review
- Diff selection → Change review: scopes review
- Change review → Diagnostics: formats findings
- CLI entry → SARIF output: formats output
- CLI entry → Lint result: prints findings