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/
Metadata
Release files for flake8-useless-assert 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8-useless-assert-0.4.4.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_useless_assert-0.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / flake8-useless-assert-0.4.4.tar.gz
| Download URL | flake8-useless-assert-0.4.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
336bcc5e558fee11593b4294ccda46777eb873cb4445e51a0edeecf9d8517b42
|
|
BLAKE2b-256 checksum How to use checksums |
1c49e339616bb19e784dabeacb9f009146daeb07713c58576f92ffb5dd91bc08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.7.12 Linux/5.10.161-1-MANJARO
|
Release files / flake8_useless_assert-0.4.4-py3-none-any.whl
| Download URL | flake8_useless_assert-0.4.4-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f1c0c579eaaf008721bc0d0db2e3391355a8dacd06b5ac63c1bab0c9e29e51f
|
|
BLAKE2b-256 checksum How to use checksums |
39a4005ea50e98f2a63d0e568fc0fefab0aa408781d5a0d3b8571f36c80b9401
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.6 CPython/3.7.12 Linux/5.10.161-1-MANJARO
|