flake8 plugin to catch useless `assert` statements
Project description
flake8-useless-assert
flake8 plugin to catch useless assert
statements
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}" |
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
Close
Hashes for flake8-useless-assert-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a1a13e51f4f4a80ba363c6eb0ddb895465be38a5a4fd63b4c6d944960bf426f |
|
MD5 | 9c7312402b1170962d6c49539a918598 |
|
BLAKE2b-256 | aa38aa9c0919c825ac1859c0826bfd31de465a2a3a48671e4d9ae58093253874 |
Close
Hashes for flake8_useless_assert-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9c3f38c264ba2d6a77f926c8015e13cc78f188232ab5b178bc8f6bcf529ddc5 |
|
MD5 | b5505dfc73e3f9fdf5fb3d9e04c0e73d |
|
BLAKE2b-256 | 1ab628c6c34f422238ab6550cc1548e8eda60e60e96cd0546312d98b5bd386ec |