Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat
https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat
- Owner: flake8-implicit-str-concat
- License: mit
- Created: 2019-11-26T18:55:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-01T20:30:18.000Z (4 months ago)
- Last Synced: 2024-07-25T17:30:07.520Z (4 months ago)
- Language: Python
- Size: 85 KB
- Stars: 31
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-implicit-str-concat - Plugin to encourage correct string literal concatenation. (Clean code)
README
# flake8-implicit-str-concat
[![PyPI version](https://img.shields.io/pypi/v/flake8-implicit-str-concat.svg)](https://pypi.org/project/flake8-implicit-str-concat)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/flake8-implicit-str-concat.svg)](https://pypi.org/project/flake8-implicit-str-concat)
[![PyPI downloads](https://img.shields.io/pypi/dm/flake8-implicit-str-concat.svg)](https://pypistats.org/packages/flake8-implicit-str-concat)
[![GitHub](https://img.shields.io/github/license/flake8-implicit-str-concat/flake8-implicit-str-concat.svg)](LICENSE)
[![Code style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)This is a plugin for the Python code-checking tool [Flake8](https://flake8.pycqa.org/)
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](https://github.com/psf/black/issues/26)), or unnecessary plus operators for
explicit string literal concatenation.## Install
```sh
pip install flake8-implicit-str-concat
```## Example
```console
$ 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](https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat/releases).