Flake8 plugin to forbid backslashes for line breaks
Project Links
Meta
Author: Nikita Sobolev
Requires Python: >=3.8,<4.0
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
Framework
- Flake8
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Operating System
- OS Independent
Programming Language
- Python :: 3
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
Topic
- Software Development :: Libraries :: Python Modules
- Software Development :: Quality Assurance
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.
1.0.0
May 31, 2023
0.6.0
Oct 03, 2022
0.5.0
Aug 11, 2022
0.4.0
Oct 19, 2021
0.3.0
Oct 29, 2020
0.2.1
Jul 08, 2020
0.2.0
Mar 13, 2020
0.1.1
Aug 09, 2019
0.1.0
Sep 30, 2018
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
flake8
(>5)