Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.0s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
N/A (auto-discovered plugin)
✓ No direct import statement is needed. The plugin is automatically loaded by Flake8 upon installation.
flake8-broken-line integrates directly into the flake8 CLI. Its checks (e.g., N400) are enabled implicitly after installation.
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.
Debug
Known issues
breakingOlder versions of `flake8-broken-line` may not be compatible with newer major versions of `flake8`. For example, versions prior to 0.4.0 might not support `flake8` 4.x, and versions prior to 0.5.0 might not support `flake8` 5.x.fixAlways upgrade `flake8-broken-line` to its latest version (1.0.0 or newer) to ensure compatibility with recent `flake8` installations (typically `flake8 >= 5.0`). Check the project's release notes for specific compatibility matrix if issues arise.
affects: <1.0.0
gotchaVersions of `flake8-broken-line` prior to 0.2.1 contained a bug that caused incorrect flagging of backslashes used within triple-quoted strings (e.g., `"""docstring\ncontinuation"""`), leading to false positives.fixUpgrade to `flake8-broken-line` version 0.2.1 or newer to resolve the issue of false positives when detecting backslashes within triple-quoted string literals.
affects: <0.2.1
gotchaThere are known limitations where the plugin might not correctly handle backslashes in specific contexts, such as raw f-strings (e.g., `rf"...\n..."`) or where PEP 8 historically allowed backslashes for `with` statements. This can result in unexpected `N400` errors or missed violations.fixIf encountering unexpected `N400` errors or missed violations in specific scenarios (like `rf` strings), refer to the official GitHub issues page to check for known limitations or potential workarounds. You may need to use `# noqa: N400` as a temporary measure.
affects: All versions up to 1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released May 31, 2023
Audit
Dependencies
flake8requiredThis is a plugin for Flake8 and requires Flake8 to be installed to function correctly.