Skip to content

UltiRequiem/yamlfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YAMLFMT

Go Report Card Go Reference

A simple and extensible yaml formatter.

Installation

go install github.com/UltiRequiem/yamlfmt@latest

You can also use the binaries from releases.

Usage

  • To format one or more files and write to stdout:

    yamlfmt a.yaml b.yaml c.yaml
  • To format one or more files in the replace mode:

    yamlfmt -w a.yaml b.yaml c.yaml

    If you want to log the files that have been formatted, you can use the -l flag also.

  • To format stdin and write to stdout:

    cat a.yaml | yamlfmt
  • To format stdin and write to a file:

    cat a.yaml | yamlfmt > b.yaml
  • To format every file in your current directory and subdirectories:

    • Using find:

      yamlfmt -w $(find -name "*.yaml")
    • Using fd:

      yamlfmt -w $(fd -H -e yaml)

Editor Integration

Neovim / Vim

au FileType yaml let &l:formatprg= "yamlfmt /dev/stdin"

It can Probably integrate with others editors easily but I only use Neovim. If you know how to integrate it with some other editor, please open a pull requests or issue with the information.

Authors

Eliaz Bobadilla - Creator and Maintainer 💪

See also the full list of contributors who participated in this project ✨

Support

Open an Issue, I will check it a soon as possible 👀

If you want to hurry me up a bit send me a tweet 😆

Consider supporting me on Patreon if you like my work 🙏

Don't forget to star the repo ⭐

Licence

Licensed under the MIT License 📄