format

package
v0.3.0-rc.7-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 7 Imported by: ? 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 format owns canonical pipeline spec formatting for editor, builder, preview, and CLI workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	Code               string `json:"code"`
	Message            string `json:"message"`
	StepSlug           string `json:"step_slug"`
	ReferencedStepSlug string `json:"referenced_step_slug"`
}

Diagnostic reports formatter-only issues that affected canonical ordering.

func FormatData

func FormatData(format string, data []byte) ([]byte, []Diagnostic, error)

FormatData parses serialized JSON or YAML pipeline data using the explicit format requested by the caller and emits formatted data in the same format.

func FormatJSON

func FormatJSON(pipeline *pipelinespec.Pipeline) ([]byte, []Diagnostic, error)

FormatJSON returns canonical indented JSON for the formatted pipeline spec.

type Result

type Result struct {
	Spec        pipelinespec.Pipeline `json:"spec"`
	Diagnostics []Diagnostic          `json:"diagnostics"`
}

Result is the formatted pipeline spec plus non-fatal formatter diagnostics.

func Format

func Format(pipeline *pipelinespec.Pipeline) (Result, error)

Format returns a copy of the pipeline with steps ordered for stable visual layout. It intentionally does not call pipeline validation: formatting must tolerate draft-like specs and report only diagnostics for references that affect ordering.

Jump to

Keyboard shortcuts

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