Flake8 plugin to forbid debug function usage
Project description
flake8-debug
A simple flake8 plugin that forbids the usage of
breakpoint
andpdb.set_trace
functions in production code.
Tools
Production
- python 3.7+
- flake8
Development
Installation
PYPI
pip install flake8-debug
✨ 🍰 ✨
Source code
git clone git@github.com:vyahello/flake8-debug.git
cd flake8-debug
python3 -m venv venv
. venv/bin/activate
pip install -e .
Errors
Codes
DB100
- print function is forbidden.
DB200
- breakpoint function is forbidden.
DB201
- breakpointhook function is forbidden.
DB300
- set_trace function is forbidden.
Sample
# foo.py
from sys import breakpointhook
from pdb import set_trace
def bar(*a):
print(a)
breakpoint()
breakpointhook()
set_trace()
flake8 foo.py
foo.py:6:5: DB100 print() function usage is detected
foo.py:7:5: DB200 breakpoint() function usage is detected
foo.py:8:5: DB201 breakpointhook() function usage is detected
foo.py:9:5: DB300 set_trace() function usage is detected
Development notes
Testing
Please run the following script to start plugin tests:
pytest
CI
To be able to run code analysis, please execute command below:
./analyse-source-code.sh
Meta
Author – Vladimir Yahello.
Distributed under the MIT
license. See license for more information.
You can reach out me at:
- vyahello@gmail.com
- https://twitter.com/vyahello
- https://www.linkedin.com/in/volodymyr-yahello-821746127
Contributing
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
- Configure
git
for the first time after cloning with yourname
andemail
pip install -r requirements.txt
to install all project dependenciespip install -r requirements-dev.txt
to 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
What's next
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for flake8_debug-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c76186c81b19b86db9b46f36bcc33e97face3af29626cef33cc70c9a69a6628 |
|
MD5 | 3b937a9f2a96076bdea43e93254201b4 |
|
BLAKE2b-256 | 1e73073c1a717de2b140c42e433263f0e231a4abb7ab3f9ef7e37e3677d560a7 |