flake8 plugin which checks for code that can be simpified
Project description
flake8-simplify
A flake8 plugin that helps you simplify your code.
Installation
Install with pip:
pip install flake8-simplify
Python 3.6 to 3.8 are supported.
Usage
Just call flake8 . in your package or flake your.py:
$ flake8 .
./foo/__init__.py:690:12: SIM101 Multiple isinstance-calls which can be merged into a single call for variable 'other'
Rules
SIM101: Multiple isinstance-calls which can be merged into a single call by using a tuple as a second argument.
Examples
SIM101
# Bad
isinstance(a, int) or isinstance(a, float)
# Good
isinstance(a, (int, float))
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_simplify-0.1.0.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_simplify-0.1.0.tar.gz.
File metadata
- Download URL: flake8_simplify-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
942002dbed2aba3fbe08fcf5a23eeb8a0cc9e1790841e8b84f661e76de872be4
|
|
| MD5 |
1eecd9485f79b64630f07ed7098e189f
|
|
| BLAKE2b-256 |
b52194522ebe6a096146dd03bd0e37ab960f2851ef865f387a1f5a1509a7e103
|
File details
Details for the file flake8_simplify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flake8_simplify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb91e363aab4bba2f413ae1347676cb5f8d6f17f56579b99619a82cb4dbf80e1
|
|
| MD5 |
cb15a82ac8b866f117f2066a4abffc3f
|
|
| BLAKE2b-256 |
414f7049a8d7d6dc06bcb9c4912e37a48f290d12832311ecccedf147d7410967
|