Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsfehler/flake8-multiline-containers
A Flake8 plugin to ensure a consistent format for multiline containers.
https://github.com/jsfehler/flake8-multiline-containers
flake8 flake8-extensions linter python3
Last synced: 13 days ago
JSON representation
A Flake8 plugin to ensure a consistent format for multiline containers.
- Host: GitHub
- URL: https://github.com/jsfehler/flake8-multiline-containers
- Owner: jsfehler
- License: mit
- Created: 2019-05-22T13:44:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T12:08:06.000Z (about 2 months ago)
- Last Synced: 2024-10-11T15:12:44.923Z (28 days ago)
- Topics: flake8, flake8-extensions, linter, python3
- Language: Python
- Homepage:
- Size: 165 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-multiline-containers - Plugin to ensure a consistent format for multiline containers. (Clean code)
README
===========================
flake8-multiline-containers
===========================.. image:: https://img.shields.io/pypi/v/flake8-multiline-containers.svg
:target: https://pypi.org/project/flake8-multiline-containers
:alt: PyPI.. image:: https://img.shields.io/pypi/pyversions/flake8-multiline-containers.svg
:alt: PyPI - Python Version
:target: https://github.com/jsfehler/flake8-multiline-containers.. image:: https://img.shields.io/github/license/jsfehler/flake8-multiline-containers.svg
:alt: GitHub
:target: https://github.com/jsfehler/flake8-multiline-containers/blob/master/LICENSE.. image:: https://pyup.io/repos/github/jsfehler/flake8-multiline-containers/shield.svg
:target: https://pyup.io/repos/github/jsfehler/flake8-multiline-containers
:alt: Updates.. image:: https://github.com/jsfehler/flake8-multiline-containers/actions/workflows/main.yml/badge.svg
:target: https://github.com/jsfehler/flake8-multiline-containers/actions/workflows/main.yml
:alt: Build statusA `Flake8 `_ plugin to ensure a consistent format for multiline containers.
Installation
------------Install from ``pip`` with:
.. code-block:: sh
pip install flake8-multiline-containers
Rules
-----===== ====
Code Rule
===== ====
JS101 Multi-line container not broken after opening character
JS102 Multi-line container does not close on same column as opening
===== ====Examples
--------.. code-block:: python
# Right: Opens and closes on same line
foo = {'a': 'hello', 'b': 'world'}# Right: Line break after parenthesis, closes on same column as opening
foo = {
'a': 'hello',
'b': 'world',
}# Right: Line break after parenthesis, closes on same column as opening
foo = [
'hello', 'world',
]# Wrong: JS101
foo = {'a': 'hello',
'b': 'world',
}# Wrong: JS101, JS102
foo = {'a': 'hello',
'b': 'world'}# Wrong: JS101, JS102
foo = {'hello',
'world'
}