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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for flake8-broken-line-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f74e052833324a9e5f0055032f7ccc54b23faabafe5a26241c2f977e70b10b50
MD5 075939d2756ca63cbb2af541ac1d01ec
BLAKE2b-256 96d164dbcae0ca9c10b9a8dd608c40423fae906452b0096252ecb6cfaff340bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flake8_broken_line-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 611f79c7f27118e7e5d3dc098ef7681c40aeadf23783700c5dbee840d2baf3af
MD5 cbba6b3c3b26641fe567528a22c45b55
BLAKE2b-256 8bcc150a4a3a8cd3bea9d176a786c09f68d078f9a13e986a0b2050e5c0a2f246

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