lkfmt (Likianta flavored formatter) is an integration of black + isort +
autoflake with pre-defined settings to reformat my Python script code.
black+isort+autoflakeintegration- 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/forstatements - align
:in dict key-value pairs - align
=in multi-line assignments - tweak
blackstyles to balance the visual weight - use
# nofmtto skip formatting (like# noqa)
(not yet published)pip install lkfmt
pip install git+https://github.com/likianta/lkfmt.gituse 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

