
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
flake8-useless-assert
Advanced tools
flake8 plugin to catch useless assert
statements
Download or install on the PyPI page
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'" |
I haven't set up proper testing yet, but you can run poetry install
and then:
flake8 examples/
FAQs
flake8 plugin to catch useless `assert` statements
We found that flake8-useless-assert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.