Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_assert_msg-1.1.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

flake8_assert_msg-1.1.1-py2.py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page