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.1]
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.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0279e2415aea18ced58c057de4f1d9eff8b3e7444304356e2fc8d34196882123 |
|
MD5 | 7f5e81831bc4f5dab74ac67d02930a70 |
|
BLAKE2b-256 | 64645aa9f5c84627622539eca3c8c26490bec2a9d51ee2c1135ae3e45dccdff4 |