Skip to content

CoderDeltaLAN/pybuglint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pybuglint

Python 3.12 Lint: Ruff Code style: black Coverage CI Donate

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.


✨ Features

  • 🔍 Scan files or directories (.py).
  • 📋 Built-in rules:
    • Equality vs None (== None → use is None).
    • Bare except: blocks.
    • Mutable default arguments ([], {}).
    • Shadowing Python builtins (list, dict, id, type…).
    • Residual print(...) statements (use logging instead).
  • 🎨 Beautiful tabular reports powered by Rich.
  • ✅ Fully tested (100% coverage).
  • 🐍 Requires Python 3.12.

🚀 Installation

# Clone the repo
git clone https://github.com/CoderDeltaLAN/pybuglint.git
cd pybuglint

# Install dependencies
poetry install --no-interaction

🛠 Usage

# Scan a directory
poetry run pybuglint src

# Scan a single file
poetry run pybuglint my_script.py

📋 Example Output

┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 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

🔧 Development

# Lint + autofix
poetry run ruff check . --fix
poetry run ruff format .
poetry run black .

# Run tests with coverage
poetry run pytest -q

🤝 Contributing

  1. Fork this repo.
  2. Create a new branch:
    git checkout -b feat/add-rule
  3. Make sure everything passes (lint + tests):
    poetry run ruff check . --fix
    poetry run black .
    poetry run pytest -q
  4. Commit and push:
    git commit -m "feat: add new detection rule"
    git push origin feat/add-rule
  5. Open a Pull Request 🚀

📌 Roadmap

  • Configurable rules via YAML.
  • Pre-commit integration.
  • Optional automatic fixes.
  • Publish to PyPI (pip install pybuglint).

🔍 SEO Keywords

AI code analyzer, Python linter, bug detection CLI, refactor AI code, Python static analysis, clean code automation, catch bugs early, developer productivity tools.


💖 Donations & Sponsorship

Support open-source: your donations keep projects clean, secure, and continuously evolving for the global community.

Donate


👤 Author

CoderDeltaLAN (Yosvel)
📧 coderdeltalan.cargo784@8alias.com
🐙 github.com/CoderDeltaLAN


📄 License

This project is licensed under the MIT License.
See the LICENSE file for details.


.github/FUNDING.yml

custom: ["https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW"]

About

Static analysis to catch bugs early. Strict pipeline: ruff, black, pytest, CI/CD.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published