Flake8 plugin that forbids implicit str/bytes literal concatenations
Project description
flake8-no-implicit-str-concat-in-list
Flake8 plugin that forbids implicit str/bytes literal concatenations inside literals such as lists, sets and tuples.
# NG
a = ["aaa",
"bbb"
"ccc"]
# OK
print('foobar' 'baz')
a = ["aaa",
"bbb"
+ "ccc"]
b = b'abcdef'
s = ('abc'
'def')
Installation
Install via pip:
pip install flake8-no-implicit-str-concat-in-list
Violation Codes
The plugin uses the prefix ICL
, short for no implicit string concatenation in lists.
Unfortunately flake8 only allows three characters for the error code prefix.
Code | Description |
---|---|
ICL122 | Implicitly concatenated bytes literals in list literal over multiple lines. |
ICL112 | Implicitly concatenated bytes literals in list literal. |
ICL121 | Implicitly concatenated str literals in list literal over multiple lines. |
ICL111 | Implicitly concatenated str literals in list literal. |
ICL222 | Implicitly concatenated bytes literals in tuple literal over multiple lines. |
ICL212 | Implicitly concatenated bytes literals in tuple literal. |
ICL221 | Implicitly concatenated str literals in tuple literal over multiple lines. |
ICL211 | Implicitly concatenated str literals in tuple literal. |
ICL322 | Implicitly concatenated bytes literals in set literal over multiple lines. |
ICL312 | Implicitly concatenated bytes literals in set literal. |
ICL321 | Implicitly concatenated str literals in set literal over multiple lines. |
ICL311 | Implicitly concatenated str literals in set literal. |
Other Plugins & Linters
- flake8-implicit-str-concat
Flake8 plugin to encourage correct string literal concatenation.
This plugin is different from
flake8-no-implicit-str-concat-in-list
because this plugin prefers implicit concatenations over explicit+
operators when concatenating literals even inside lists, tuples and set literals. - 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. - flake8-no-implicit-concat
This linter has
no_implicit_concat
rule. It also looks for implicit string concatenation but in all contexts, not just in lists.
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-no-implicit-concat, which is developed by 10sr 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
File details
Details for the file flake8_no_implicit_str_concat_in_list-0.1.0.tar.gz
.
File metadata
- Download URL: flake8_no_implicit_str_concat_in_list-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6dec674f546712b9b267b84f82ac0c9696a1ef9d5aaac8c8f9e44cc1329a54e |
|
MD5 | 3d312d6d1a15fe6e5fcb2554d038e731 |
|
BLAKE2b-256 | 2a127f78d4331e803742e008d976781c2251b4bb8b476da16a4a57500bc7d307 |
File details
Details for the file flake8_no_implicit_str_concat_in_list-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: flake8_no_implicit_str_concat_in_list-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7772cc8d8fc424d4ad93598e6cf6e83e1db32a56904814254f6761e24c2aa643 |
|
MD5 | ca2d77d950e042548fe8480406ad59be |
|
BLAKE2b-256 | 359ede0f6f167223d70cdcf39f256955d823a7d9128ea4ad5d4870eda627ec6f |