Skip to main content

Flake8 plugin that forbids implicit string literal concatenations

Project description

Github Actions codecov PyPI - Python Version PyPI version Downloads Code style: black

flake8-no-implicit-concat

Flake8 plugin that forbids implicit string literal concatenations.

# NG
a = "abc" "def"
b = ["aaa",
     "bbb"
     "ccc"]
# OK
a = "abcdef"
b = ["aaa",
     "bbb" +
     "ccc"]

Installation

Install via pip:

pip install flake8-no-implicit-concat

Violation code

The plugin uses the prefix NIC, short for No Implicit Concatenation.

Code Description
NIC001 Implicitly concatenated string literals in one line
NIC002 Implicitly concatenated string literals over multiple lines

Other Plugins & Linters

  • flake8-implicit-str-concat Flake8 plugin to encourage correct string literal concatenation. flake8-no-implicit-concat is different from this plugin because there are cases where this plugin prefers implicit concatenations over explicit + operators.
  • wemake-python-styleguide Set of strict flake8 rules with several plugins as dependencies. It implements WPS326 Found implicit string concatenation, which also checks implicit string concatenations, as one of the many rules it defines.
  • pylint This linter has implicit-str-concat rule. By default it only looks for occurrences of implicit concatenations on the same line, but it has --check-str-concat-over-line-jumps=y option to enable checking of concatenations over multiple lines.

Development

Use tools like Pipenv:

pipenv run python -m pip install -e .[dev]
pipenv run make check

License

This software is licensed under MIT license. See LICENSE for details.

The code was derived from flake8-implicit-str-concat, which is developed by Dylan Turner and also licensed under MIT license.

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-no-implicit-concat-0.2.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file flake8-no-implicit-concat-0.2.1.tar.gz.

File metadata

  • Download URL: flake8-no-implicit-concat-0.2.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for flake8-no-implicit-concat-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4c81f69bf09c94a5c9b8e620203e7022bc585c973356d103130552eea80b13de
MD5 5d681211b34a1fe342d5811d87d0df1b
BLAKE2b-256 030eae8ff594916ab957d6b57545ad7f92d2b7d40df2e6c5d75ec56aa238e088

See more details on using hashes here.

File details

Details for the file flake8_no_implicit_concat-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: flake8_no_implicit_concat-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for flake8_no_implicit_concat-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa49fc2533ef96691346eb9488cc0bd6dfcab23668ce97e12223fd79992c7016
MD5 275b8ec3fbd71cbfd78a85ea32ddfcd2
BLAKE2b-256 09aecf496b189839bc95cc415bd43c138289074cd5d94ee6a3c2347247d00ac9

See more details on using hashes here.

Supported by

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