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 code
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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef00e31370e99e0f880018d8bc0d179cf2293b67f33d3f97259219218f2f26a3 |
|
MD5 | 241f3ad70ce015fb54a6482f823359fd |
|
BLAKE2b-256 | 6db4ea46ea35dd507ed9da9cf8dfcb88ba3acb25b69deda3accd5a135b63d817 |
Close
Hashes for flake8_no_implicit_concat-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6de4a5a3e46475e7c2ba649461c81d05a97eab65113fabaac37d706881b243d |
|
MD5 | 29d3812fcda6cc8c658523571ffd4517 |
|
BLAKE2b-256 | 44f1478f0ef64741f2125cbbd8f439ccdac5373fab1866e81718b5160a1f491b |