Registry / testing / flake8-no-implicit-concat

flake8-no-implicit-concat

JSON →
library0.3.7pypypiunverified

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.

testing
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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).

# Install the plugin pip install flake8-no-implicit-concat # Create a Python file with implicit concatenation (e.g., example.py) # print('hello' 'world') # Run flake8 to detect the issue flake8 example.py # Output will include a 'NIC' error, e.g.: # example.py:1:7: NIC001 Implicit string literal concatenation.
Debug
Known footguns
gotchaImplicit 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.
gotchaBy 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.
gotchaThis 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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
ahrefsbot
4
gptbot
3
script
1
bingbot
1
Resources