Skip to main content

Flake8 plugin to forbid backslashes for line breaks

Project description

flake8-broken-line

wemake.services Build Status Coverage 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.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

flake8_broken_line-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flake8-broken-line-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.4 CPython/3.7.3 Darwin/18.6.0

File hashes

Hashes for flake8-broken-line-0.2.0.tar.gz
Algorithm Hash digest
SHA256 550d217ebcdb1d3febc3a7dd5962b2deb4f809a5b0f10b7632b416c4877d2760
MD5 fdb2f8b90ed1d9c5586f1dc9516fb50e
BLAKE2b-256 1f1ee8402f97ecb49cab092983769b405aa253f9fae4b8f38ed12f1e31d694b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flake8_broken_line-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 167130fcb4761755e9919c0bc8f984ff5790df1ff7a4447fed5c00b09ea6b4c3
MD5 2be811ccaa0b9150921995a5a7f0dbfc
BLAKE2b-256 8d3a56d1ac2444c71d62f4f83b64eedcd4ffdc0171ac048638f930bd85170115

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