antislop
A blazing-fast, multi-language linter for detecting AI-generated code slop.
Antislop helps you maintain code quality by identifying lazily generated code, deferrals, hedging, and placeholders often left behind by AI coding assistants.
What is Slop?
AI models often produce code that works but is littered with signs of hesitation or incompleteness. Antislop detects:
- Placeholders:
TODO,FIXME,HACK,XXXcomments - Deferrals: "for now", "temporary fix", "quick implementation"
- Hedging: "hopefully", "should work", "assumes"
- Stubs: Empty functions or macro stubs like
todo!() - Noise: Redundant comments like
// increments i
Philosophy
Antislop is built on First Principles:
- Code is Liability: Every line of code is a future maintenance cost.
- Intent != Implementation: Comments like
TODOorfor nowsignal a gap between what was intended and what was built. - Speed is a Feature: Verification must be instant to be useful.
We believe that AI generated code should be treated with Zero Trust. Verify everything.
Pattern Hygiene (MECE)
We follow a Mutually Exclusive, Collectively Exhaustive strategy with standard linters like MegaLinter.
- Antislop: Detects AI shortcuts (stubs, hallucinated API usage, hedging).
- Standard Linters: Detect syntax errors, style issues, and bugs.
- Rule: If
eslintorclippycatches it by default, Antislop will not cover it (unless explicitly whitelisted).
Comparison
| Feature | Antislop | Standard Linters (ESLint/Clippy) | AI Refactors |
|---|---|---|---|
| Focus | Intent & Completeness | Syntax & Best Practices | Improvements |
| Speed | Milliseconds | Seconds/Minutes | Slow |
| Parsing | Hybrid (Regex + AST) | AST Only | AST/LLM |
| Target | AI Slop | Bugs/Style | Refactoring |
| LSP | Yes | Yes | Sometimes |
Demo
$ antislop src/
src/main.rs:42:15: CRITICAL [stub]
! Empty function body found
→ fn calculate_metrics() { todo!() }
src/legacy.py:10:5: MEDIUM [deferral]
! Deferral phrase detected
→ # for now we just return True
src/utils.js:5:1: LOW [noise]
! Redundant comment
→ // utility function
────────────────────────────────────────────────────────────
📁 15 scanned, 3 with findings
⚠ 3 total findings
💀 75 sloppy score
⚠⚠⚠ High slop detected
Performance
Antislop uses tree-sitter AST parsing for accurate detection. Regex-only mode is ~10x faster.
| Language | Mode | Time | Throughput |
|---|---|---|---|
| Python | AST | 4.0 ms | 416 KiB/s |
| JavaScript | AST | 1.5 ms | 856 KiB/s |
| TypeScript | AST | 4.9 ms | 381 KiB/s |
| Go | AST | 1.3 ms | 1.2 MiB/s |
| Rust | AST | 3.6 ms | 606 KiB/s |
| Python | Regex | 0.47 ms | — |
| Rust | Regex | 0.54 ms | — |
Scaling:
| Lines | Time |
|---|---|
| 1,000 | 10.5 ms |
| 10,000 | 78 ms |
| 50,000 | 392 ms |
Benchmarks run on standard laptop hardware (Linux x86_64). Run cargo bench to reproduce.
Installation
From Pre-built Binaries (Recommended)
# via npm (downloads platform-specific binary)
# via cargo-dist (Shell)
|
# via Homebrew
# via PowerShell
From Source
Usage
# Scan current directory
# Scan specific paths
# JSON output (for integration)
# Custom config
Profiles
Antislop follows a Zero False Positive philosophy for its default core.
- Core (Default): Critical stubs & placeholders only. Zero false positives.
- trict (
--profile antislop-strict): Maximum coverage. Detects all forms of slop. - Standard (
--profile antislop-standard): Recommended Baseline. Adds checks for deferrals ("for now"), hedging ("should work"), and dummy data. - Strict (
--profile antislop-strict): Maximum coverage.
# Recommended for most projects
| Profile | Focus | Best For |
|---|---|---|
| Core | TODO, FIXME, Stubs |
CI Pipelines (Blocker) |
| Standard | + Deferrals, Hedging, Mock Data | Daily Development |
| Strict | + Nitpicks, Style Enforced | Code Audits |
CI/CD Integration
GitHub Actions Example:
jobs:
antislop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Antislop
run: curl -sSf https://raw.githubusercontent.com/skew202/antislop/main/install.sh | sh
- name: Run Scan
run: antislop --profile antislop-standard .
Installation Options
Antislop is modular. You can optimize for binary size by choosing specific languages:
# Default (Standard Languages)
# Minimal (Regex only, no AST)
# Specific Languages (Tiny binary)
# All Languages (inc. C#, PHP, Ruby, Kotlin, etc.)
Configuration
Create antislop.toml in your project root to customize patterns:
= [".py", ".rs", ".js", ".ts"]
[[]]
= "(?i)TODO:"
= "medium"
= "Placeholder comment found"
= "placeholder"
Language Support
| Language | Extension | Support Level |
|---|---|---|
| C/C++ | .c, .cpp |
Full (AST + Regex) |
| C# | .cs |
Full (AST + Regex) |
| Go | .go |
Full (AST + Regex) |
| Haskell | .hs |
Full (AST + Regex) |
| Java | .java |
Full (AST + Regex) |
| JavaScript | .js |
Full (AST + Regex) |
| Kotlin | .kt |
Regex Only |
| Lua | .lua |
Full (AST + Regex) |
| Perl | .pl |
Regex Only |
| PHP | .php |
Regex Only |
| Python | .py |
Full (AST + Regex) |
| R | .r |
Regex Only |
| Ruby | .rb |
Full (AST + Regex) |
| Rust | .rs |
Full (AST + Regex) |
| Scala | .scala |
Full (AST + Regex) |
| Swift | .swift |
Regex Only |
| TypeScript | .ts |
Full (AST + Regex) |
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.