{"id":6637,"library":"flake8-no-implicit-concat","title":"flake8-no-implicit-concat","description":"flake8-no-implicit-concat is a Flake8 plugin designed to forbid implicit string and bytes literal concatenations in Python code. It helps enforce a coding style where string concatenation is always explicit, thereby preventing subtle bugs caused by accidentally concatenated literals. The current version is 0.3.7, and the project maintains an active release cadence with regular updates.","status":"active","version":"0.3.7","language":"en","source_language":"en","source_url":"https://github.com/10sr/flake8-no-implicit-concat","tags":["flake8","linter","code-quality","string-concatenation","python","static-analysis"],"install":[{"cmd":"pip install flake8-no-implicit-concat","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This is a plugin for Flake8 and requires Flake8 to be installed to function.","package":"flake8","optional":false}],"imports":[],"quickstart":{"code":"# Install the plugin\npip install flake8-no-implicit-concat\n\n# Create a Python file with implicit concatenation (e.g., example.py)\n# print('hello' 'world')\n\n# Run flake8 to detect the issue\nflake8 example.py\n\n# Output will include a 'NIC' error, e.g.:\n# example.py:1:7: NIC001 Implicit string literal concatenation.","lang":"bash","description":"After installation, `flake8-no-implicit-concat` is automatically registered with Flake8. Simply run `flake8` on your project to start detecting implicit string/bytes literal concatenations. The plugin uses error codes prefixed with 'NIC' (No Implicit Concatenation)."},"warnings":[{"fix":"Ensure all string concatenations are explicit (e.g., using `+` or `.join()`) or that separate string literals in collections are properly delimited by commas.","message":"Implicit string concatenation can lead to silent and hard-to-debug errors, especially when defining lists or tuples where a missing comma can result in two intended separate string elements becoming a single concatenated string. This plugin helps prevent such issues.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add `--check-str-concat-over-line-jumps=y` to your Flake8 command or configuration file (e.g., `setup.cfg`, `pyproject.toml`) to enforce checking across line jumps.","message":"By default, `flake8-no-implicit-concat` only checks for implicit concatenations on the same line (NIC001). To also check for concatenations spanning multiple lines, you need to enable the `--check-str-concat-over-line-jumps=y` option.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review your project's coding style guide and select the appropriate plugin. If you want to strictly forbid all implicit concatenations, `flake8-no-implicit-concat` is the correct choice.","message":"This plugin specifically *forbids* implicit string concatenation. Be aware that another popular plugin, `flake8-implicit-str-concat`, has different goals and may *encourage* implicit concatenation in certain multi-line scenarios (e.g., within parentheses for PEP 8 compliance). Choose the plugin that aligns with your desired coding style.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}