Usage
Basic Usage
# Scan current directory
antislop
# Scan specific paths
antislop src/ tests/
# Scan single file
antislop examples/sloppy.py
Output Formats
# Human-readable (default)
antislop src/
# JSON output
antislop --json src/
# SARIF for GitHub Security
antislop --format sarif > results.sarif
Profiles
AntiSlop follows the Unix philosophy: minimal defaults, extensible via profiles.
By default, only Core patterns (stubs, critical placeholders) are enabled.
For most projects, we recommend the antislop-standard profile.
# Recommended baseline (Standard profile)
antislop --profile antislop-standard src/
# Strict checking (All patterns)
antislop --profile antislop-strict src/
# List available profiles
antislop --list-profiles
Category Control
Fine-tune your scan by enabling/disabling specific pattern categories:
# Disable specific categories
antislop --disable hedging src/
antislop --disable hedging,deferral src/
# Only scan specific categories
antislop --only stub src/
antislop --only stub,placeholder src/
Profile Management
# Load a local profile file
antislop --profile .antislop/profiles/custom.toml src/
# Load a remote profile
antislop --profile https://example.com/profiles/strict.toml src/
Options
| Option | Description |
|---|---|
-c, --config <FILE> | Path to config file |
--profile <NAME> | Load a community profile (file, URL, or name) |
--list-profiles | List available profiles |
--disable <CATS> | Disable categories (comma-separated) |
--only <CATS> | Only enable categories (comma-separated) |
--hygiene-survey | Run code hygiene survey (detect linters, formatters, CI/CD) |
--json | Output in JSON format |
--format <FMT> | Output format: text, json, sarif |
-m, --max-size <KB> | Maximum file size to scan (default: 1024) |
-e, --extensions <EXT> | File extensions to scan (comma-separated) |
-v, --verbose | Verbose output (use -vv, -vvv for more) |
--completions <SHELL> | Generate shell completions |
--list-languages | List supported languages |
--print-config | Print default configuration |
--no-filename-check | Disable filename convention checking |
Hygiene Survey
Run a comprehensive code hygiene survey to discover project setup and tooling:
antislop --hygiene-survey
The survey detects:
- Project types (Rust, Python, JavaScript, TypeScript, Go, Java, etc.)
- Linters & Formatters (clippy, rustfmt, ESLint, Prettier, Ruff, etc.)
- CI/CD Pipelines (GitHub Actions, GitLab CI, Jenkins, CircleCI)
- Pre-commit hooks (pre-commit, husky, lefthook)
It provides recommendations for missing tools based on your project type.
Examples
JSON Output
antislop --json src/ > results.json
SARIF for GitHub Security
antislop --format sarif > results.sarif
Custom Extensions
antislop -e .py,.rs,.js src/
Verbose Mode
antislop -vv src/
Shell Completions
# For bash
antislop --completions bash > ~/.local/share/bash-completion/completions/antislop
# For zsh
antislop --completions zsh > ~/.zfunc/_antislop
# For fish
antislop --completions fish > ~/.config/fish/completions/antislop.fish
Exit Codes
| Code | Meaning |
|---|---|
0 | No slop detected |
1 | Slop found |
2 | Error (config, file access, etc.) |
Integration
Pre-commit Hook
Add to .pre-commit-config.yaml:
repos:
- repo: https://github.com/skew202/antislop
rev: v0.1.0
hooks:
- id: antislop
GitHub Action
- uses: skew202/antislop@v1
with:
args: src/