Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

UltiRequiem/yamlfmt

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YAMLFMT

Go Report Card Go Reference

A simple and extensible yaml formatter.

Code coverage: https://ulti.js.org/yamlfmt

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 💪

Big thanks to @Antoineio for helping with the tests and CI! 🎉

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

Licence

Licensed under the MIT License 📄

Releases

Sponsor this project

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.