Skip to main content

Flake8 plugin to encourage correct string literal concatenation

Project description

flake8-implicit-str-concat

PyPI version Supported Python versions PyPI downloads GitHub Actions status Codecov Licence Code style: Black Tidelift

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_implicit_str_concat-0.6.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_implicit_str_concat-0.6.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file flake8_implicit_str_concat-0.6.0.tar.gz.

File metadata

File hashes

Hashes for flake8_implicit_str_concat-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2611436664ebf452f57bf0b3229fb88b58a828e4b22733bd781ce8f1b676ff2b
MD5 fb073cc6e186080c326dd7f3e23ede6c
BLAKE2b-256 c654e107032a932866e9c79103115990b2e43d9a391366ce518d0d5b39601f4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for flake8_implicit_str_concat-0.6.0.tar.gz:

Publisher: release.yml on flake8-implicit-str-concat/flake8-implicit-str-concat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flake8_implicit_str_concat-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_implicit_str_concat-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67dafdcf2ecf0437b308974dfa397b9162b654f65b01d7ad961fca595a03cba0
MD5 6f30990b82d78b7232b6b0acb4b8e591
BLAKE2b-256 899079a199cd6df0b8736b23906282eebf0e2bdaffdb45c5ddcb7e2295aa7462

See more details on using hashes here.

Provenance

The following attestation bundles were made for flake8_implicit_str_concat-0.6.0-py3-none-any.whl:

Publisher: release.yml on flake8-implicit-str-concat/flake8-implicit-str-concat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page