Skip to main content

All-in-one Python code formattor which is tailored of `black` + `isort` + `autoflake` for myself taste.

Project description

Likianta Flavored Formatter

lkfmt (Likianta flavored formatter) is an integration of black + isort + autoflake with pre-defined settings to reformat my Python script code.

Features

  • black + isort + autoflake integration
  • out-of-box settings
  • one command to drive
  • additional format styles by lk-flavor (work in progress)
    • keep indents on empty lines
    • ensure newline at end of file
    • merge one-line if/for statements
    • align : in dict key-value pairs
    • align = in multi-line assignments
    • tweak black styles to balance the visual weight
    • use # nofmt to skip formatting (like # noqa)

Installation

pip install lkfmt (not yet published)

pip install git+https://github.com/likianta/lkfmt.git

Usage

use in command line:

# after installation, there's an executable named `lkfmt`.

# get help
lkfmt -h

# format files in current dir
lkfmt .
# it can also be shorthand as `lkfmt` (no argument)

# format files in current dir and subdirs recursively
lkfmt -r .

# format one file
lkfmt $file

# show difference (but not inplace file)
python -m lkfmt show-diff $file

Screenshots

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lkfmt-0.2.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file lkfmt-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: lkfmt-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.1 Darwin/21.2.0

File hashes

Hashes for lkfmt-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b05e99233a5b6cae252187fc598f29db3a3083ac36501173380b7fa675d4696
MD5 98d1b4ffea0f766a33e51abd152e14e2
BLAKE2b-256 6d9c6af85375089a593c3bd1778724b9f3b0286d7810a33c69f09568440135d5

See more details on using hashes here.

Supported by

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