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 formating 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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a662364c0389a14f5c94a807eda3ac81ab545ba8d75aa244c022af4a7b121eec |
|
MD5 | f2075be46d05611d06ecb032fd0cda6c |
|
BLAKE2b-256 | 844ea9814a76421db131d13bdfdca2ce62d79bf7a075c321aa382af252554f4a |
Close
Hashes for flake8_implicit_str_concat-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea856c22cd8dbd4ecb8d091e92784ce09a3083f1763df895693bf887d21acef5 |
|
MD5 | 7605c1787b731b8201dc8081317aa1cb |
|
BLAKE2b-256 | 3e22edb766d31996b087d09a5e2293b57aaf59e3b5d295d6eb6d5c6a948d8b52 |