Skip to main content

Semi-automated Python formatting.

Project description

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()
]

Development

Setup with:

pip install -r script/requirements-dev.txt -e .

Run validations with:

./script/check

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuck-0.2.5.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuck-0.2.5-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file tuck-0.2.5.tar.gz.

File metadata

  • Download URL: tuck-0.2.5.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for tuck-0.2.5.tar.gz
Algorithm Hash digest
SHA256 857b0a26c5a6e9a4f606f08d927ec4034342d4153939826f2d2bf06989d086bb
MD5 520329e37561c4bc3d39fd9bf01ca16c
BLAKE2b-256 f3444e567600248f88e276042091d2f0b65c993fb974fca3d295dcf6d3e9567c

See more details on using hashes here.

File details

Details for the file tuck-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: tuck-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for tuck-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8e829755fe4cda4346c6fc5a4a606903c5d0b273388e4257b473bd7cf327bc9a
MD5 8173a7d1b15f0108b45a0c6ac3d627e0
BLAKE2b-256 0287aa7af87d83a1ffd97afd06b7de8bb3a430a2eb32a67195ef56798998dc6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page