Skip to content

PeterJCLaw/tuck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5096dec · May 16, 2024
Feb 17, 2023
Jun 27, 2020
May 16, 2024
Jul 15, 2023
Jul 15, 2023
Jul 21, 2020
Mar 14, 2020
Jan 23, 2021
Feb 18, 2023
Mar 8, 2020
May 10, 2020
May 16, 2024
May 16, 2024
May 10, 2020

Repository files navigation

Tuck

CircleCI

Semi-automated Python formatting.

The aim of this tool is to build up developer-assistance tooling for python formatting. In general it will only format things when it needs to or when directly instructed to.

Usage

Most usage of Tuck is expected to be within editor extensions:

Tuck can be also used as a command line tool:

python -m tuck --positions <line>:<col> -- file.py

Style

The wrapped statement style which Tuck targets aims to reduce diff noise without concern for vertical space.

Example: Function definition

def foo(bar: str, quox: int = 0) -> float:
    return 4.2

wraps to:

def foo(
    bar: str,
    quox: int = 0,
) -> float:
    return 4.2

Example: List comprehension

[x for x in 'aBcD' if x.isupper()]

wraps to:

[
    x
    for x in 'aBcD'
    if x.isupper()
]