Skip to main content

A flake8 plugin that helps you wrap code with visual balance.

Project description

flake8-balanced-wrapping

CircleCI

A flake8 plugin that helps you wrap code with visual balance.

The aim of this linter is to complement the use of developer-assistance python formatting tools, i.e: those where the developer remains in control of when to format code a particular way, while still enforcing a consistent style of how the code is formatted.

Style

The style which this linter checks for is one which aims for clarity and visual balance while reducing diff noise, without concern for vertical space. This is similar to the tuck wrapping tool.

As much as possible this linter will not duplicate checks provided by other plugins where they are are in agreement.

Example: Function definitions

# Unwrapped
def foo(bar: str, quox: int = 0) -> float:
    return 4.2

# Wrapped
def foo(
    bar: str,
    quox: int = 0,
) -> float:
    return 4.2

Example: List comprehension

# Unwrapped
[x for x in 'aBcD' if x.isupper()]

# Wrapped
[
    x
    for x in 'aBcD'
    if x.isupper()
]

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-balanced-wrapping-0.1.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

flake8_balanced_wrapping-0.1.3-py2.py3-none-any.whl (9.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flake8-balanced-wrapping-0.1.3.tar.gz.

File metadata

File hashes

Hashes for flake8-balanced-wrapping-0.1.3.tar.gz
Algorithm Hash digest
SHA256 53ab32e5392761bfb74b74eccb7d77aa2f14e927f71e9eb9be9f2020a17a5e12
MD5 d904e2a5fbcc251d90cbd07949353e9f
BLAKE2b-256 db26ad24d0bcb94264182dc144db2805167bff1b3b3f9b71050ab99ae9fa6e69

See more details on using hashes here.

Provenance

File details

Details for the file flake8_balanced_wrapping-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_balanced_wrapping-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ad00838a9cc1fe3a3c146255edc65212cc495d2298e88e3342f084bfaddddd95
MD5 045a6913e82fe3c6dc9cde5273ca79dd
BLAKE2b-256 72c42735504c6d1d92cce45bc792f80a741c1eededc74353af6c97bef9af6031

See more details on using hashes here.

Provenance

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