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:

  • IFSTMT001: 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

  • ...

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-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flake8-if-statements-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for flake8-if-statements-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88d57da0b9bfeee46e416169086b65e23171939f8d08a9773097423a43c683eb
MD5 925fe4e01abc817d3c2792e7c50cc70a
BLAKE2b-256 a90ca1fde206457d6e8d82c3e76bae0d34e8276935f648fa6366f49bca31b821

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flake8_if_statements-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for flake8_if_statements-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30bbf55b4206919820a7e1c3719034215d7256b7c2844cc77b9ef5a75f171214
MD5 fa75b74ad1dc557f25ef124c77673393
BLAKE2b-256 fe50ce7a657c54eda8b3e294eaa5c033b1f6ff54a21f914240f353e64493a9a5

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