flake8 plugin to catch useless `assert` statements
Project description
flake8-useless-assert
flake8 plugin to catch useless assert
statements
Download or install on the PyPI page
Violations
Code | Description | Example |
---|---|---|
ULA001 | assert with a truthy literal |
assert "foo" |
assert ... |
||
assert True |
||
ULA002 | assert with 0 |
assert 0 |
ULA003 | assert with None |
assert None |
ULA004 | assert with "literal".format(...) |
assert "foo {0}".format(bar) |
ULA005 | assert with f-string |
assert f"foo {bar}" |
ULA006 | assert with constant computation |
assert "foo" == "bar" * 3 |
assert repr("fizz") == "'buzz'" |
Testing
I haven't set up proper testing yet, but you can run poetry install
and then:
flake8 examples/
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
File details
Details for the file flake8-useless-assert-0.4.4.tar.gz
.
File metadata
- Download URL: flake8-useless-assert-0.4.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.7.12 Linux/5.10.161-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 336bcc5e558fee11593b4294ccda46777eb873cb4445e51a0edeecf9d8517b42 |
|
MD5 | 931559ade43104ec47d215967e278e5a |
|
BLAKE2b-256 | 1c49e339616bb19e784dabeacb9f009146daeb07713c58576f92ffb5dd91bc08 |
File details
Details for the file flake8_useless_assert-0.4.4-py3-none-any.whl
.
File metadata
- Download URL: flake8_useless_assert-0.4.4-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.7.12 Linux/5.10.161-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1c0c579eaaf008721bc0d0db2e3391355a8dacd06b5ac63c1bab0c9e29e51f |
|
MD5 | a152f92c80c447f89c2a7298488b0010 |
|
BLAKE2b-256 | 39a4005ea50e98f2a63d0e568fc0fefab0aa408781d5a0d3b8571f36c80b9401 |