pybuglint — A modern Python CLI tool to detect and report “almost-bugs” often found in AI-generated code. Designed for developers who want clean, safe and production-ready code, with zero noise and actionable feedback.
- 🔍 Scan files or directories (
.py
). - 📋 Built-in rules:
- Equality vs
None
(== None
→ useis None
). - Bare
except:
blocks. - Mutable default arguments (
[]
,{}
). - Shadowing Python builtins (
list
,dict
,id
,type
…). - Residual
print(...)
statements (uselogging
instead).
- Equality vs
- 🎨 Beautiful tabular reports powered by Rich.
- ✅ Fully tested (100% coverage).
- 🐍 Requires Python 3.12.
# Clone the repo
git clone https://github.com/CoderDeltaLAN/pybuglint.git
cd pybuglint
# Install dependencies
poetry install --no-interaction
# Scan a directory
poetry run pybuglint src
# Scan a single file
poetry run pybuglint my_script.py
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Rule ┃ Line ┃ Snippet ┃ Suggestion ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Mutable default argument │ 1 │ def f(a=[]):│ Avoid mutables as defaults │
│ Residual print statement │ 2 │ print(a) │ Remove prints; use logging │
└──────────────────────────┴───────┴─────────────┴────────────────────────────┘
If nothing is found:
No findings
# Lint + autofix
poetry run ruff check . --fix
poetry run ruff format .
poetry run black .
# Run tests with coverage
poetry run pytest -q
- Fork this repo.
- Create a new branch:
git checkout -b feat/add-rule
- Make sure everything passes (lint + tests):
poetry run ruff check . --fix poetry run black . poetry run pytest -q
- Commit and push:
git commit -m "feat: add new detection rule" git push origin feat/add-rule
- Open a Pull Request 🚀
- Configurable rules via YAML.
- Pre-commit integration.
- Optional automatic fixes.
- Publish to PyPI (
pip install pybuglint
).
AI code analyzer, Python linter, bug detection CLI, refactor AI code, Python static analysis, clean code automation, catch bugs early, developer productivity tools.
Support open-source: your donations keep projects clean, secure, and continuously evolving for the global community.
CoderDeltaLAN (Yosvel)
📧 [email protected]
🐙 github.com/CoderDeltaLAN
This project is licensed under the MIT License.
See the LICENSE file for details.
custom: ["https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW"]