https://github.com/ultirequiem/yamlfmt
⚡ Blazing fast YAML formatter
https://github.com/ultirequiem/yamlfmt
cli formatter go go-formatter golang golang-application yaml
Last synced: 15 days ago
JSON representation
⚡ Blazing fast YAML formatter
- Host: GitHub
- URL: https://github.com/ultirequiem/yamlfmt
- Owner: UltiRequiem
- License: mit
- Created: 2021-09-07T01:03:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T16:45:10.000Z (about 1 month ago)
- Last Synced: 2025-04-13T10:02:51.384Z (17 days ago)
- Topics: cli, formatter, go, go-formatter, golang, golang-application, yaml
- Language: Go
- Homepage: https://pkg.go.dev/github.com/UltiRequiem/yamlfmt
- Size: 27.3 KB
- Stars: 29
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# YAMLFMT
[](https://goreportcard.com/report/github.com/UltiRequiem/yamlfmt)
[](https://pkg.go.dev/github.com/UltiRequiem/yamlfmt/pkg)A simple and extensible [yaml](https://yaml.org) formatter.
Code coverage: https://ulti.js.org/yamlfmt
## Installation
```bash
go install github.com/UltiRequiem/yamlfmt@latest
```You can also use the binaries from
[releases](https://github.com/UltiRequiem/yamlfmt/releases).## Usage
- To format one or more files and write to stdout:
```bash
yamlfmt a.yaml b.yaml c.yaml
```- To format one or more files in the replace mode:
```bash
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:
```bash
cat a.yaml | yamlfmt
```- To format stdin and write to a file:
```bash
cat a.yaml | yamlfmt > b.yaml
```- To format every file in your current directory and subdirectories:
- Using `find`:
```bash
yamlfmt -w $(find -name "*.yaml")
```- Using `fd`:
```bash
yamlfmt -w $(fd -H -e yaml)
```## Editor Integration
### Neovim / Vim
```viml
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](https://ultirequiem.xyz) - Creator and Maintainer 💪
Big thanks to @Antoineio for helping with the tests and CI! 🎉
See also the full list of
[contributors](https://github.com/UltiRequiem/yamlfmt/contributors) who
participated in this project ✨## Licence
Licensed under the MIT License 📄