Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decorator-factory/flake8-useless-assert
flake8 plugin to catch useless `assert` statements
https://github.com/decorator-factory/flake8-useless-assert
Last synced: about 2 months ago
JSON representation
flake8 plugin to catch useless `assert` statements
- Host: GitHub
- URL: https://github.com/decorator-factory/flake8-useless-assert
- Owner: decorator-factory
- License: mit
- Created: 2021-11-23T21:14:42.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T22:57:29.000Z (over 1 year ago)
- Last Synced: 2024-05-07T17:22:14.979Z (about 2 months ago)
- Language: Python
- Size: 23.4 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-flake8-extensions - flake8-useless-assert - Detect useless `assert` statements. (Bugs)
README
# flake8-useless-assert
flake8 plugin to catch useless `assert` statementsDownload or install on the [PyPI page](https://pypi.org/project/flake8-useless-assert/)
# 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/
```