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 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
File details
Details for the file flake8_implicit_str_concat-0.5.0.tar.gz
.
File metadata
- Download URL: flake8_implicit_str_concat-0.5.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101e1d5bde84cb3b042e5929d3ab975222e5143c2c4163493a448e023ae1a9e8 |
|
MD5 | 34b63dbf795b9fbd5f100a3379a3f74d |
|
BLAKE2b-256 | 22c33b667a843506d2d73a6217512168e6be9fa1ebb4cf4166e45f500dc235de |
Provenance
The following attestation bundles were made for flake8_implicit_str_concat-0.5.0.tar.gz
:
Publisher:
release.yml
on flake8-implicit-str-concat/flake8-implicit-str-concat
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
flake8_implicit_str_concat-0.5.0.tar.gz
- Subject digest:
101e1d5bde84cb3b042e5929d3ab975222e5143c2c4163493a448e023ae1a9e8
- Sigstore transparency entry: 141915355
- Sigstore integration time:
- Predicate type:
File details
Details for the file flake8_implicit_str_concat-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: flake8_implicit_str_concat-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b14f629f7fc020f0dd65283741c02681997fa83c20c317f57d3db6bb5cb222e |
|
MD5 | 08f662cfda7425cb7d2cd234f1bea234 |
|
BLAKE2b-256 | ff5c786d0048233b809fb424f94483d3b041687567ff127bac1d2f10bbf3675a |
Provenance
The following attestation bundles were made for flake8_implicit_str_concat-0.5.0-py3-none-any.whl
:
Publisher:
release.yml
on flake8-implicit-str-concat/flake8-implicit-str-concat
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
flake8_implicit_str_concat-0.5.0-py3-none-any.whl
- Subject digest:
0b14f629f7fc020f0dd65283741c02681997fa83c20c317f57d3db6bb5cb222e
- Sigstore transparency entry: 141915356
- Sigstore integration time:
- Predicate type: