Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterjclaw/tuck
Semi-automated python formatting
https://github.com/peterjclaw/tuck
formatter python
Last synced: 21 days ago
JSON representation
Semi-automated python formatting
- Host: GitHub
- URL: https://github.com/peterjclaw/tuck
- Owner: PeterJCLaw
- License: apache-2.0
- Created: 2019-12-11T19:33:07.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T21:15:34.000Z (6 months ago)
- Last Synced: 2024-10-14T20:36:44.360Z (about 1 month ago)
- Topics: formatter, python
- Language: Python
- Homepage:
- Size: 165 KB
- Stars: 5
- Watchers: 14
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 : -- 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()
]
```