yamlfmt

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package yamlfmt formats the YAML of a workflow, as gofmt formats Go: there is one way a workflow is laid out, and nothing to configure.

It changes only the whitespace and the comments of a file, never what the file says: scalars are left as they are written, quotes and all.

  • Indentation is two spaces, and a sequence is not indented under the key it belongs to.
  • A blank line separates the keys at the top of a file when either holds a mapping or a sequence written on the lines under it, and the jobs from one another. There is no other blank line, apart from those a scalar holds.
  • A comment on its own line is indented as the line it comes before, and one at the end of a line is a single space from it. Each has a space after its #.
  • A key is a single space from its value, and a - from its entry.
  • No line ends in whitespace, and the file ends in a single newline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(src []byte) ([]byte, error)

Format returns src formatted. It returns an error when src is not YAML, and never returns YAML that means anything other than src does.

Types

This section is empty.

Jump to

Keyboard shortcuts

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