Flake8 plugin that forbids implicit str/bytes literal concatenations
Project description
flake8-no-implicit-concat
Flake8 plugin that forbids implicit str/bytes literal concatenations.
# NG
print('foo' 'bar', 'baz')
a = ["aaa",
"bbb"
"ccc"]
b = b'abc' b'def'
# OK
print('foobar', 'baz')
a = ["aaa",
"bbb"
+ "ccc"]
b = b'abcdef'
Installation
Install via pip:
pip install flake8-no-implicit-concat
Violation Codes
The plugin uses the prefix NIC
, short for No Implicit Concatenation.
Code | Description |
---|---|
NIC001 | Implicitly concatenated str literals on one line |
NIC002 | Implicitly concatenated str literals over multiple lines |
NIC101 | Implicitly concatenated bytes literals on one line |
NIC102 | Implicitly concatenated bytes literals over multiple lines |
Other Plugins & Linters
- flake8-implicit-str-concat
Flake8 plugin to encourage correct string literal concatenation.
This plugin is different from
flake8-no-implicit-concat
because this plugin prefers implicit concatenations over explicit+
operators when concatenating literals over multiple lines. - wemake-python-styleguide
Set of strict flake8 rules with several plugins as dependencies.
It implements
WPS326 Found implicit string concatenation
, which also checks implicit string concatenations, as one of the many rules it defines. - pylint
This linter has
implicit-str-concat
rule. By default it only looks for occurrences of implicit concatenations on the same line, but it has--check-str-concat-over-line-jumps=y
option to enable checking of concatenations over multiple lines.
Development
Use tools like Pipenv:
pipenv run python -m pip install -e .[dev]
pipenv run make check
License
This software is released under MIT license. See LICENSE
for details.
The code was derived from flake8-implicit-str-concat, which is developed by Dylan Turner and also released under MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for flake8-no-implicit-concat-0.3.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e675477c40b21d9481915a4a257260b17e29137b0b76406657c3605f79b2b42 |
|
MD5 | 68153c04b3bb8d06098de8e285bf641f |
|
BLAKE2b-256 | 1f3cc86797634204844c29eb60e00bdf2079cdda97d40905e861e57af60b9567 |
Close
Hashes for flake8_no_implicit_concat-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454b0c6df39c03bd8b1891abc9317981901a72ef426a4d56eb5fc689eef8fc65 |
|
MD5 | 462824a64f161851119f141671c346d5 |
|
BLAKE2b-256 | 270d9f3e09dd88b3bf321465d5d78e37aeb4f9022ee6764ea003d9ec455b2d61 |