yamlfmt

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

yamlfmt

Build Status

Formats yaml files.

Install

Linux:
sudo snap install yamlfmt
Brew
brew install devopyio/yamlfmt/yamlfmt
Windows
scoop bucket add yamlfmt https://github.com/devopyio/scoop-yamlfmt
scoop install yamlfmt
Using go get
go get -u github.com/devopyio/yamlfmt

Usage

cat example.yaml | yamlfmt

Or you can simply execute:

yamlfmt -filename example.yaml

Example:

"groups": 
- "name": "etcd"
  "rules": 
  - "alert": "EtcdInsufficientMembers"
    "annotations": 
      "message": "Etcd cluster \"{{ $labels.job }}\": insufficient members ({{ $value }})."
    "expr": |
      count(up{job="etcd"} == 0) by (job) > (count(up{job="etcd"}) by (job) / 2 - 1)
    "for": "3m"
    "labels": 
      "severity": "critical"

Becomes:

groups:
- name: etcd
  rules:
  - alert: EtcdInsufficientMembers
    annotations:
      message: 'Etcd cluster "{{ $labels.job }}": insufficient members ({{ $value
        }}).'
    expr: |
      count(up{job="etcd"} == 0) by (job) > (count(up{job="etcd"}) by (job) / 2 - 1)
    for: 3m
    labels:
      severity: critical

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