Show HN: Sloppylint – A linter for AI-generated Python code
6 days ago
- #ai-generated-code
- #code-quality
- #linting
- Sloppylint is a tool to detect AI-generated code anti-patterns in Python and other languages (JavaScript, Java, Ruby, Go, C#, PHP).
- It identifies over 100 patterns, including mutable default arguments, bare excepts, and placeholder functions.
- The tool provides a 'Slop Score' breakdown by axes like Information Utility, Quality, Style, and Structural Issues.
- Common issues detected include mutable defaults, bare excepts, placeholder functions, and hallucinated imports.
- Sloppylint can scan directories or specific files, filter by severity, and generate JSON reports for CI/CD.
- It also detects language-specific anti-patterns leaking from other languages into Python.
- Installation is via pip, with optional features for colored output and additional checks.
- Configuration is supported via pyproject.toml, allowing customization of ignored files and disabled checks.
- The tool is open-source, MIT-licensed, and includes development setup instructions.
- References include related projects and research on AI-generated code quality.