flake8-debug
A simple flake8 plugin that forbids the usage of
breakpointandpdb.set_tracefunctions in production code.
Tools
Production
- python 3.9+
- 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 detected.DB200- breakpoint function is detected.DB201- breakpointhook function is detected.DB300- set_trace function is detected.
Sample
# 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
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
gitfor the first time after cloning with yournameandemail pip install -r requirements.txtto install all project dependenciespip 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
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.
Metadata
Release files for flake8-debug 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8_debug-0.3.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_debug-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / flake8_debug-0.3.0.tar.gz
| Download URL | flake8_debug-0.3.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c0be5325d3a5d7ba47ab71c447ea898d47397bd8cf532dda4e8f7c9e1d86b02
|
|
BLAKE2b-256 checksum How to use checksums |
ee13ceaf235fca8d14c67ef925220efc80f6ee85e51264ecc51b668e740953da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / flake8_debug-0.3.0-py3-none-any.whl
| Download URL | flake8_debug-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a909623a5f619dbd333d5c9859a4af0eb7b82a6047225d605993569f9769a45
|
|
BLAKE2b-256 checksum How to use checksums |
7c04b3492aea14cc33750456ca5d550a6986968e823a623277c66d42e4149fae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|