{"id":4537,"library":"flake8-broken-line","title":"Flake8 Broken Line","description":"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.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/wemake-services/flake8-broken-line","tags":["flake8","linter","code quality","style guide","code formatting"],"install":[{"cmd":"pip install flake8-broken-line","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"This is a plugin for Flake8 and requires Flake8 to be installed to function correctly.","package":"flake8","optional":false}],"imports":[{"note":"flake8-broken-line integrates directly into the flake8 CLI. Its checks (e.g., N400) are enabled implicitly after installation.","symbol":"N/A (auto-discovered plugin)","correct":"No direct import statement is needed. The plugin is automatically loaded by Flake8 upon installation."}],"quickstart":{"code":"# test_broken_line.py\n\nmessage = 'This is a long string that \\\n           uses a backslash for line continuation.'\n\ndef my_function(arg1, \\\n                arg2): # This backslash is a violation\n    pass\n\n# To run this example, save the code as 'test_broken_line.py'\n# and execute 'flake8 test_broken_line.py' in your terminal.\n# You should see an N400 error reported.","lang":"python","description":"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."},"warnings":[{"fix":"Always 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.","message":"Older 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.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Upgrade 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.","message":"Versions 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.","severity":"gotcha","affected_versions":"<0.2.1"},{"fix":"If 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.","message":"There 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.","severity":"gotcha","affected_versions":"All versions up to 1.0.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}