flake8 plugin which forbids assert statements without messages
Project description
flake8-assert-msg
flake8 plugin which forbids assert statements without messages.
Installation
pip install flake8-assert-msg
flake8 codes
Code | Description |
---|---|
ASS001 | do not use bare asserts |
Rationale
This ensures that assertions have clear messages for failures. Adding a message to an assertion also acts as documentation for why the assertion is present.
As a pre-commit hook
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies: [flake8-assert-msg==1.1.0]
Acknowledgements
- https://github.com/asottile/flake8-walrus used as a template
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 Distribution
Built Distribution
Close
Hashes for flake8_assert_msg-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f158a939d3e05a6911e21ba149d5f449c78f7f1d5e9ee1fe58a20e5a4682e59d |
|
MD5 | dbf6a575c0714ec300657443dd31f78f |
|
BLAKE2b-256 | 1b5c2c5e8ff1162f584e5a1d3f7b6075a1806820eb91588c51ed7b2db169df52 |