Flake8 plugin to encourage correct string literal concatenation.
Project description
flake8-implicit-str-concat
This is a plugin for the Python code-checking tool Flake8 to encourage correct string literal concatenation.
It looks for style problems like implicitly concatenated string literals on the same line (which can be introduced by the code-formatting tool Black), or unnecessary plus operators for explicit string literal concatenation.
Install
pip install flake8-implicit-str-concat
Example
$ cat example.py
s = ('111111111111111111111'
'222222222222222222222')
$ black example.py
reformatted example.py
All done! ✨ 🍰 ✨
1 file reformatted.
$ cat example.py
s = "111111111111111111111" "222222222222222222222"
$ flake8 example.py
example.py:1:28: ISC001 implicitly concatenated string literals on one line
$ edit example.py # Remove the " " and save
$ cat example.py
s = "111111111111111111111222222222222222222222"
$ black example.py
All done! ✨ 🍰 ✨
1 file left unchanged.
$ flake8 example.py
$
Violation codes
The plugin uses the prefix ISC
, short for Implicit String Concatenation.
Code | Description |
---|---|
ISC001 | implicitly concatenated string literals on one line |
ISC002 | implicitly concatenated string literals over continuation line |
ISC003 | explicitly concatenated string should be implicitly concatenated |
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_implicit_str_concat-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0e6ae227e46238e4c87844091f8072892caeccd3bb266576a7d449eadbf53a0 |
|
MD5 | 3131d74bd5c5c9eedcddd3be068f6ddf |
|
BLAKE2b-256 | da7a0384b279b685e9866ec013512a4d0be6c51b57890401f24d16a3d1e512b5 |
Close
Hashes for flake8_implicit_str_concat-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a89ebc50567790fb7b83e032ed4014ae0db70e35d89e269c3323967135023600 |
|
MD5 | 1370f2c6d4cf83027fa744a28a124715 |
|
BLAKE2b-256 | 25764925cc27d50a2559f44f61f7a359638812b499a298b929e2d94d7679a627 |