Flake8 plugin to forbid backslashes for line breaks
Project description
flake8-broken-line
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flake8-broken-line-0.6.0.tar.gz
.
File metadata
- Download URL: flake8-broken-line-0.6.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.0 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a02268f11a18837c83c59013a36cc00fee9e17a042745cc0c9895f1c9f6acc16 |
|
MD5 | c1ede859598dc3b4c55c51c28a4a9f34 |
|
BLAKE2b-256 | 315f214a869897c26fdf58d16b73178055fcc7cb7b458c276a93ba92cead440f |
File details
Details for the file flake8_broken_line-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: flake8_broken_line-0.6.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.0 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ab336ff7de228dbffbe56d67b3615bb21fb15f3ed0604fa7bdf9feb72d7d88 |
|
MD5 | a027d7643596cbef59fc6f864af1accf |
|
BLAKE2b-256 | 132b70c59ff68729ae568ad2169e2bfe76bae6d6d159561057dd3b8bd44be76d |