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
a = 'abc' 'def'
b = ["aaa",
"bbb"
"ccc"]
c = b'hoge' b'fuga'
# OK
a = 'abcdef'
b = ["aaa",
"bbb" +
"ccc"]
c = b'hogefuga'
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 licensed under MIT license. See LICENSE
for details.
The code was derived from flake8-implicit-str-concat, which is developed by Dylan Turner and also licensed 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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b9aef1b980af72f64cd0e7db0a64067e88c46a544f31673292b53de01283a4 |
|
MD5 | 2d52c8f9c2e1ef417dc54675cd7f3225 |
|
BLAKE2b-256 | 9c0b4d9916caca2c9466a1008b5d026318bb5de6e3e9dde5141cdb5c0931daa8 |
Close
Hashes for flake8_no_implicit_concat-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0fd2158dbb2166d431794bc5a382faca537fca724980dac31b3895b16441c38 |
|
MD5 | e5dc0d3b2ae17525e6cbeae36def5f96 |
|
BLAKE2b-256 | 4e11463bc828be52dac11263ec6afa7623fc970a5d3ef9202b83b9211c923199 |