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 Code style: Black

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

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.3.0.tar.gz (2.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.3.0-py2.py3-none-any.whl (3.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: flake8_implicit_str_concat-0.3.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for flake8_implicit_str_concat-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c0e6ae227e46238e4c87844091f8072892caeccd3bb266576a7d449eadbf53a0
MD5 3131d74bd5c5c9eedcddd3be068f6ddf
BLAKE2b-256 da7a0384b279b685e9866ec013512a4d0be6c51b57890401f24d16a3d1e512b5

See more details on using hashes here.

File details

Details for the file flake8_implicit_str_concat-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: flake8_implicit_str_concat-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for flake8_implicit_str_concat-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a89ebc50567790fb7b83e032ed4014ae0db70e35d89e269c3323967135023600
MD5 1370f2c6d4cf83027fa744a28a124715
BLAKE2b-256 25764925cc27d50a2559f44f61f7a359638812b499a298b929e2d94d7679a627

See more details on using hashes here.

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