Home

Awesome

PyPI version PyPI - Python Version Downloads Github Actions Codecov

flake8-no-implicit-concat

Flake8 plugin that forbids implicit str/bytes literal concatenations.

# Not Allowed
print('foo' 'bar', 'baz')
a = ["aaa",
     "bbb"
     "ccc"]
b = b'abc' b'def'

# OK
print('foobar', 'baz')
a = ["aaa",
     "bbb"
     + "ccc"]
b = b'abcdef'

Installation

Install via pip:

pip install flake8-no-implicit-concat

Violation Codes

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

CodeDescription
NIC001Implicitly concatenated str literals on one line
NIC002Implicitly concatenated str literals over multiple lines
NIC101Implicitly concatenated bytes literals on one line
NIC102Implicitly concatenated bytes literals over multiple lines

Other Plugins & Linters

Development

Use tools like Pipenv:

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

License

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

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