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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bd1e9dd9bab3fa58a9e9dddfcf889c3df331007d9fa2bb47a2e07530b97adbe |
|
MD5 | 1f3b36d05f3037021f83cb16a09e75c7 |
|
BLAKE2b-256 | 1b9c7e2fe198f8b63995530f977911f91a7898a8a5977c2c66a4017b5d38751f |
Close
Hashes for flake8_implicit_str_concat-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09d9c9be1bc50b1d12e783c1381dd214b855eb29427fc644c3f0fb96522f01b0 |
|
MD5 | 1f2576039ecb7f6901418459d7cb10b1 |
|
BLAKE2b-256 | d889454765c6e340de26c58b7388c77053f2c54fd3c70f53af8c3e36de1cfde9 |