validate

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package validate is the validate command: the repo's AML, checked.

Index

Constants

This section is empty.

Variables

View Source
var Validate = command.Define(command.Def[ValidateInput, aml.RepoValidation]{
	Name:     "validate",
	Short:    "Validate the AML repo, optionally scoped to file globs",
	ReadOnly: true,
	Timeout:  5 * time.Minute,
	Needs:    func(ValidateInput) command.Sidecars { return command.Sidecars{Node: true} },
	Run: func(ctx context.Context, cc command.CommandContext, in ValidateInput) (aml.RepoValidation, error) {
		if err := command.RequireSidecars(cc, command.Sidecars{Node: true}); err != nil {
			return aml.RepoValidation{}, err
		}
		res, err := aml.Validate(ctx, cc.Clients.Node, cc.Repo, in.Globs)
		if err != nil {
			return res, err
		}

		if local, ok := cc.Repo.Local(); ok {
			res.Reports = append(res.Reports, appReports(local.Dir, in.Globs)...)
		}
		return res, nil
	},
	Valid: func(r aml.RepoValidation) bool { return r.Valid },
})

Validate checks the AML repo, optionally scoped to file globs.

Functions

This section is empty.

Types

type ValidateInput

type ValidateInput struct {
	Globs []string `json:"globs,omitempty" cli:"positional" doc:"optional file globs; report only diagnostics for matching files"`
}

ValidateInput is validate's input.

func (ValidateInput) TransformSchema

func (ValidateInput) TransformSchema(_ huma.Registry, s *huma.Schema) *huma.Schema

Jump to

Keyboard shortcuts

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