Skip to content

choval/formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formatter

  • Python -> autoflake + isort + black
  • PHP -> pint (psr12)
  • JavaScript -> js-beautify
  • CSS -> css-beautify
  • JSON -> jq
  • Yaml -> yamlfix

Requirements

  • Docker 🐳

Installation

To run as a CLI

curl -o ~/formatter https://raw.githubusercontent.com/choval/formatter/master/formatter
chmod +x ~/formatter
mv ~/formatter ~/.local/bin/formatter

Move to a bin path like ~/bin or ~/local/bin or ~/.local/bin

Update

docker pull ghcr.io/choval/formatter

Uninstall

# Remove the script
rm `which formatter`
# Remove the hook
rm .git/hooks/pre-commit
docker rmi ghcr.io/choval/formatter

Usage

With installed binary, will format all files (unlimited depth) in the current directory and format all files.

Caution

It will not prompt or wait for confirmation!

formatter [PATH]

Directly through docker.

docker run -v `pwd`:/src ghcr.io/choval/formatter /src

License

MIT, see LICENSE.