Metadata-Version: 2.4
Name: tuck
Version: 0.2.5
Summary: Semi-automated Python formatting.
Home-page: https://github.com/PeterJCLaw/tuck
Author: Peter Law
Author-email: PeterJCLaw@gmail.com
License: Apache 2.0
Project-URL: Issue tracker, https://github.com/PeterJCLaw/tuck/issues
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: asttokens<4,>=2
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Tuck

[![CircleCI](https://circleci.com/gh/PeterJCLaw/tuck/tree/main.svg?style=svg)](https://circleci.com/gh/PeterJCLaw/tuck/tree/main)

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:

- [VSCode Tuck Extension](https://marketplace.visualstudio.com/items?itemName=peterjclaw.tuck)

Tuck can be also used as a command line tool:

``` bash
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

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

wraps to:

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

**Example**: List comprehension

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

wraps to:

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

## Development

Setup with:

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

Run validations with:

``` bash
./script/check
```
