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 |
Release Notes
You can find the release notes on the [https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat/releases](releases page).
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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6acf233afee943dc1802ef4bc242a19f0419fac9943739e235d3f2aaf616361 |
|
MD5 | b12a72bf02a24916c5f787eed76971b4 |
|
BLAKE2b-256 | dea42cdbe12c014e80b7a1d0b301305861ee30e85091406fb75ee085fcdb044e |
Close
Hashes for flake8_implicit_str_concat-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91805a3e0ff30ae2890830548478af25c79a4a579ec402a6ba3538043dff60c |
|
MD5 | 8fc382c665ad153c890d28aaaa3265bc |
|
BLAKE2b-256 | 58d5a41d35ba2a4f2b4b253afe7ae441f881acd392c830d65a0d73fa71be80b7 |