Flake8 Broken Line

1.0.0 · active · verified Sun Apr 12

flake8-broken-line is a Flake8 plugin that enforces a coding style prohibiting the use of backslashes for line breaks in Python code. It helps maintain code readability and consistency by encouraging alternative line-breaking conventions, such as using parentheses for implicit line joining. The current version is 1.0.0, and it maintains a moderate release cadence, with updates typically focusing on Python and Flake8 compatibility.

Warnings

Install

Imports

Quickstart

Install the plugin, create a Python file containing a backslash for line continuation, and then run `flake8` against the file to observe the `N400` error reported by the plugin.

# test_broken_line.py

message = 'This is a long string that \
           uses a backslash for line continuation.'

def my_function(arg1, \
                arg2): # This backslash is a violation
    pass

# To run this example, save the code as 'test_broken_line.py'
# and execute 'flake8 test_broken_line.py' in your terminal.
# You should see an N400 error reported.

view raw JSON →