Skip to main content

Flake8 plugin to forbid backslashes for line breaks

Project description

flake8-broken-line

wemake.services Build Status codecov Python Version PyPI version wemake-python-styleguide

Do not break the line! 🚨

Installation

pip install flake8-broken-line

It is also a valuable part of wemake-python-styleguide.

Code example

Things we check with this plugin:

# String line breaks, use `()` or `"""` instead:

some_string = 'first line\
second line'

# Use a single line, `()`, or new variables instead:

if 1 == 1 and \
    2 == 2:
    print('Do not do that!')

# Do not use for method chaining:
some_object \
  .call_method(param1, param2) \
  .call_other(keyword=value) \
  .finalize()

# Instead use:
some_objects.call_method(
    param1, param2,
).call_other(
    keyword=value
).finalize()

Error codes

Error code Description
N400 Found backslash that is used for line breaking

License

MIT.

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-broken-line-0.5.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

flake8_broken_line-0.5.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file flake8-broken-line-0.5.0.tar.gz.

File metadata

  • Download URL: flake8-broken-line-0.5.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0

File hashes

Hashes for flake8-broken-line-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7c98de9dd1385b71e888709c7f2aee3f0514107ecb5875bc95d0c03392191c97
MD5 0eafe2420392911584909cbdb156c40a
BLAKE2b-256 6a670406c794646e61eb2e2bbe923a582f4ef9ecb9262233d348ad5e44353f8d

See more details on using hashes here.

File details

Details for the file flake8_broken_line-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_broken_line-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daafb19b67eead0410ce7ba155d51a15b9d020ebe7630d87de9c2b93cedb6703
MD5 fe561e7e88a15809bbbd3302060569be
BLAKE2b-256 fe5651cf9120542b41614dcadd7445bb170d0fd6efced45b3e1d689c7d710ff7

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