Skip to main content

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 literal assert "foo"
assert ...
True
ULA002 assert with a formatted string assert "foo {0}".format(bar)
assert f"foo {bar}"

Note that assert False is exempt from ULA001 because it's a common idiom.

Testing

I haven't set up proper testing yet, but you can run poetry install and then:

flake8 examples/

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-useless-assert-0.3.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_useless_assert-0.3.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file flake8-useless-assert-0.3.1.tar.gz.

File metadata

  • Download URL: flake8-useless-assert-0.3.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.7.12 Linux/5.10.70-1-MANJARO

File hashes

Hashes for flake8-useless-assert-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ff60bb2f46cad1460836a78e0c67d099efd866c3911ee958eb331daa12c8ec45
MD5 2444c4d2c5f3e2be3133c091d5a63f3a
BLAKE2b-256 b04df88d96ba3a020a16d5eb4107466a3c88a3df698dea419395c1c91f760e4a

See more details on using hashes here.

File details

Details for the file flake8_useless_assert-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_useless_assert-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b10cf08e0e62618c4bcbb63d5818c27d32dff3a5e9a51d8c3a3fcb48d9eb9ce
MD5 a31bf5737399591fd6602f09592d0bc8
BLAKE2b-256 3711a9914a28d30f734fb295b92aa293668660ce1f07e5c7654ed4241b95d45e

See more details on using hashes here.

Supported by

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