yamlfmt

command module
v0.0.0-...-16f8d3d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 17 Imported by: 0

README

yamlfmt

yamlfmt is a YAML file formatter.

Data can be read from standard input or a list of file names.

Installation

$ go get -u github.com/gechr/yamlfmt

Usage

# Read from files
$ yamlfmt 1.yaml 2.yaml 3.yaml

# Read from stdin
$ yamlfmt < 1.yaml
$ echo "foo: bar" | yamlfmt

Example

$ cat example.yaml
abc:      def
def:  hij   # foobar
k:
# n
  - l
# m
  - op
q:
  # baz
  r: s
  t:   u
  v       : w
  x:
    - "y"

    - z

$ yamlfmt example.yaml
abc: def
def: hij # foobar
k:
# n
- l
# m
- op
q:
  # baz
  r: s
  t: u
  v: w
  x:
  - "y"
  - z

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL