Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterjclaw/flake8-balanced-wrapping
A flake8 plugin that helps you wrap code with visual balance
https://github.com/peterjclaw/flake8-balanced-wrapping
Last synced: about 1 month ago
JSON representation
A flake8 plugin that helps you wrap code with visual balance
- Host: GitHub
- URL: https://github.com/peterjclaw/flake8-balanced-wrapping
- Owner: PeterJCLaw
- License: apache-2.0
- Created: 2022-09-18T21:41:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T11:49:32.000Z (11 months ago)
- Last Synced: 2024-09-17T06:10:50.360Z (2 months ago)
- Language: Python
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flake8-balanced-wrapping
[![CircleCI](https://circleci.com/gh/PeterJCLaw/flake8-balanced-wrapping/tree/main.svg?style=svg)](https://circleci.com/gh/PeterJCLaw/flake8-balanced-wrapping/tree/main)
A flake8 plugin that helps you wrap code with visual balance.
The aim of this linter is to complement the use of developer-assistance python
formatting tools, i.e: those where the developer remains in control of _when_ to
format code a particular way, while still enforcing a consistent style of _how_
the code is formatted.## Style
The style which this linter checks for is one which aims for clarity and visual
balance while reducing diff noise, without concern for vertical space. This is
similar to the [`tuck`](https://pypi.org/project/tuck/) wrapping tool.As much as possible this linter will not duplicate checks provided by other
plugins where they are are in agreement.**Example**: Function definitions
``` python
# Unwrapped
def foo(bar: str, quox: int = 0) -> float:
return 4.2# Wrapped
def foo(
bar: str,
quox: int = 0,
) -> float:
return 4.2
```**Example**: List comprehension
``` python
# Unwrapped
[x for x in 'aBcD' if x.isupper()]# Wrapped
[
x
for x in 'aBcD'
if x.isupper()
]
```