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.SIM201
: Used 'not a == b' instead of 'a != b'
Examples
SIM101
# Bad
isinstance(a, int) or isinstance(a, float)
# Good
isinstance(a, (int, float))
SIM201
# Bad
not a == b
# Good
a != b
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.2.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for flake8_simplify-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f55110e763652d3edfe6aecfad79c33f3470c6ce1b93631eda2233b1cbd4e47d |
|
MD5 | c7890140622a49982a6f093fa89f14af |
|
BLAKE2b-256 | 23e3debedfb844734417d569f646989f52f9d1fdee05634c8bb9e14541e3c570 |