Flake8 plugin to forbid debug function usage
A simple flake8 plugin that forbids the usage of
pdb.set_tracefunctions in production code.
- python 3.7+
pip install flake8-debug ✨ 🍰 ✨
git clone email@example.com:vyahello/flake8-debug.git cd flake8-debug python3 -m venv venv . venv/bin/activate pip install -e .
DB100- print function is detected.
DB200- breakpoint function is detected.
DB201- breakpointhook function is detected.
DB300- set_trace function is detected.
# foo.py import pdb from pdb import set_trace from sys import breakpointhook def bar(*a): print(a) breakpoint() breakpointhook() set_trace() pdb.set_trace()
flake8 foo.py foo.py:7:5: DB100 print() function usage is detected foo.py:8:5: DB200 breakpoint() function usage is detected foo.py:9:5: DB201 breakpointhook() function usage is detected foo.py:10:5: DB300 set_trace() function usage is detected foo.py:11:5: DB300 set_trace() function usage is detected
Please run the following script to start plugin tests:
To be able to run code analysis, please execute command below:
Author – Vladimir Yahello.
Distributed under the
MIT license. See license for more information.
You can reach out me at:
I would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:
- Clone the repository
gitfor the first time after cloning with your
pip install -r requirements.txtto install all project dependencies
pip install -r requirements-dev.txtto install all development project dependencies
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request
All recent activities and ideas are described at project issues page. If you have ideas you want to change/implement please do not hesitate and create an issue.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for flake8_debug-0.2.0-py3-none-any.whl