{"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":"python","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,"search_vec":"'0.3.7':52 'accident':45 'activ':58 'alway':37 'analysi':75 'bug':42 'byte':21 'cadenc':60 'caus':43 'code':26,31,67 'code-qu':66 'concat':5,10 'concaten':23,35,46,71 'current':49 'design':15 'enforc':29 'explicit':38 'flake8':2,7,13,64 'flake8-no-implicit-concat':1,6 'forbid':17 'help':28 'implicit':4,9,18 'linter':65 'liter':22,47 'maintain':56 'plugin':14 'prevent':40 'project':55 'python':25,72 'qualiti':68 'regular':62 'releas':59 'static':74 'static-analysi':73 'string':19,34,70 'string-concaten':69 'style':32 'subtl':41 'therebi':39 'updat':63 'version':50","created_at":"2026-04-15T18:36:27.995876+00:00","updated_at":"2026-04-16T15:04:28.360762+00:00","problems":[{"fix":"Explicitly concatenate the string literals using the `+` operator, or separate them with a comma if they are elements in a collection. For example, change `'foo' 'bar'` to `'foo' + 'bar'` or `['foo', 'bar']`.","cause":"The `flake8-no-implicit-concat` plugin detected adjacent string or bytes literals that are implicitly concatenated, which the plugin forbids to promote explicit concatenation.","error":"NIC001 Implicitly concatenated string literal"},{"fix":"Ensure `flake8-no-implicit-concat` is installed in the same environment as Flake8 (e.g., `pip install flake8 flake8-no-implicit-concat`). If it's still not working, check your Flake8 configuration files (`.flake8`, `setup.cfg`, or `pyproject.toml`) to ensure no conflicting settings are present or that the plugin isn't explicitly disabled.","cause":"The plugin might not be correctly installed within the same Python environment as Flake8, or Flake8 might not be configured to run the plugin.","error":"flake8-no-implicit-concat not working"},{"fix":"To ignore globally, add `ignore = NIC001` to your Flake8 configuration file (e.g., in `setup.cfg` under `[flake8]`). To ignore for a specific line, add `# noqa: NIC001` at the end of the line. To ignore for a specific file, add `# flake8: noqa` at the top of the file.","cause":"Users want to suppress the 'NIC001 Implicitly concatenated string literal' error for specific lines, files, or globally within their project.","error":"flake8 ignore NIC001"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/10sr/flake8-no-implicit-concat","docs":null,"changelog":"https://github.com/10sr/flake8-no-implicit-concat/blob/master/CHANGELOG.md","pypi":"https://pypi.org/project/flake8-no-implicit-concat/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-15","next_check":"2026-07-14","install_tag":null}}