A flake8 plugin that finds that finds improvements for raise statements.
Project description
A flake8 plugin that finds improvements for raise statements.
Installation
Install using pip:
$ pip install flake8-raise
When installed, the plugin will automatically be used by flake8. To check it is installed correctly, run flake8 --version and look in the list of installed plugins:
$ flake8 --version
3.7.9 (flake8-raise: 0.0.3, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.8.1 on Linux
Rules
Code |
Rule |
---|---|
R100 |
raise in except handler without from. |
Examples
The following example:
try:
foo["bar"]
except KeyError:
raise MyException
Will result in the flake8 error:
R100 raise in except handler without from.
To fix, change the code to:
try:
foo['bar']
except KeyError as e:
raise MyException from e
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
flake8-raise-0.0.3.tar.gz
(2.1 kB
view details)
Built Distribution
File details
Details for the file flake8-raise-0.0.3.tar.gz
.
File metadata
- Download URL: flake8-raise-0.0.3.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd778f64522cb0bdeb47e39fa1a136becc9b1c4d3071df2a589d1e0519fc16b6 |
|
MD5 | 62fa3f8bbaadc8220c414daad0b46e7d |
|
BLAKE2b-256 | 2810c46cc8b2b2f39516a4e93a02a359128164c9eadf693668e8d4d62897354f |
File details
Details for the file flake8_raise-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: flake8_raise-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44698aab3fa7e9fde6a971152302ab3dcac78cc7206bef29c490c5dd80fb7014 |
|
MD5 | c6b9655c30c04579f01ddb2dedce6f6f |
|
BLAKE2b-256 | 5375a63aa08f881f6020c2a9e684219866ffa4f1c1c47beb580a3013a7b725b1 |