Skip to main content

Flake8 linter for if statements

Project description

flake8-if-statements

pypi Python: 3.6+ Downloads Build Status Code coverage License: MIT Code style: black

Description

Flake8 linter for if statements

Checks:

  • IFS001: Use one liner so as not to repeat assignment to the same variable

e.g:

Bad:

if x == 1:
    y = 10
else:
    y = 11

Good:

y = 10 if x == 1 else 11

Installation

pip install flake8-if-statements

Usage

flake8 <your code>

For developers

Create venv and install deps

make init

Install git precommit hook

make precommit_install

Run linters, autoformat, tests etc.

make pretty lint test

Bump new version

make bump_major
make bump_minor
make bump_patch

License

MIT

Change Log

Unreleased

  • ...

1.0.0 - 2022-09-17

  • Changed IFSTMT to IFS to comply with flake8
  • Remove python3.6 support

0.1.0 - 2020-03-14

  • initial

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-if-statements-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

flake8_if_statements-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file flake8-if-statements-1.0.0.tar.gz.

File metadata

  • Download URL: flake8-if-statements-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for flake8-if-statements-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4de1a05c6840ed7ca419a0de6038a343317fe327401a91c887cd8661730662c9
MD5 d905f19cc4c64726b41bc6b445656ce6
BLAKE2b-256 68cfeebf980e661cc05535228c1f3e73b4c8a2c15d8e047c06559ac38eb827e2

See more details on using hashes here.

File details

Details for the file flake8_if_statements-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_if_statements-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a247fab5f409e3f2c18c3d92e1f7a9a9d1a8e0cd3aa1d446a17097e16ecddab
MD5 9b68ea72f3a3b97c0aedce53b3158d9e
BLAKE2b-256 4cd450c3630ffb4612b33c155ed69c4382002071327a6d6d66a06fc943de7e1f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page