Help us shape the future of Go! Take the 2026 Go Developer Survey

cilint

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cilint implements MCP tools for GitLab CI configuration linting.

The package wraps the GitLab CI lint API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for CI lint actions exposed as MCP tools. Both routes mirror the non-deprecated client-go ValidateService methods one-to-one: lint maps to ProjectNamespaceLint (validate arbitrary YAML in a project namespace context) and lint_project maps to ProjectLint (validate a project's committed .gitlab-ci.yml). The routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func FormatOutputMarkdown

func FormatOutputMarkdown(v Output) string

FormatOutputMarkdown renders a CI lint result as the card of one object: the verdict, then the errors, warnings, includes and jobs as the nested collections they are, then the merged YAML in a fence.

The messages are a collection and are rendered as table rows rather than as bare list items: a lint message quotes the user's own CI file back, and a message beginning with '#' or '-' opened a heading or a nested list where it was written as the content of a list item.

Types

type ContentInput

type ContentInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path (namespace context),required"`
	Content     string               `json:"content" jsonschema:"CI/CD YAML content to validate,required"`
	DryRun      *bool                `json:"dry_run" jsonschema:"Run pipeline creation simulation"`
	IncludeJobs *bool                `json:"include_jobs" jsonschema:"Include expanded job list in the response"`
	Ref         string               `json:"ref" jsonschema:"Branch or tag to use for CI includes resolution"`
}

ContentInput holds parameters for linting arbitrary CI/CD YAML within a project namespace.

type Include

type Include struct {
	Type           string `json:"type"`
	Location       string `json:"location"`
	ContextProject string `json:"context_project,omitempty"`
}

Include represents an include block found in the CI configuration.

type Output

type Output struct {
	toolutil.HintableOutput
	Valid      bool                     `json:"valid"`
	Errors     []string                 `json:"errors,omitempty"`
	Warnings   []string                 `json:"warnings,omitempty"`
	MergedYaml string                   `json:"merged_yaml,omitempty"`
	Includes   []Include                `json:"includes,omitempty"`
	Jobs       []toolutil.LintJobOutput `json:"jobs,omitempty"`
}

Output represents the result of a CI lint operation: what gitlab.ProjectLintResult decodes, plus the jobs array GitLab sends when include_jobs is set and the SDK does not carry, read from the captured response (ADR-0021).

func LintContent

func LintContent(ctx context.Context, client *gitlabclient.Client, input ContentInput) (Output, error)

LintContent validates content for the cilint package.

func LintProject

func LintProject(ctx context.Context, client *gitlabclient.Client, input ProjectInput) (Output, error)

LintProject validates project for the cilint package.

type ProjectInput

type ProjectInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	ContentRef  string               `json:"content_ref" jsonschema:"Branch or tag to use for the CI configuration content"`
	DryRun      *bool                `json:"dry_run" jsonschema:"Run pipeline creation simulation"`
	DryRunRef   string               `json:"dry_run_ref" jsonschema:"Branch or tag to use as context for the dry run"`
	IncludeJobs *bool                `json:"include_jobs" jsonschema:"Include expanded job list in the response"`
	Ref         string               `json:"ref" jsonschema:"Branch or tag to use for CI includes resolution"`
}

ProjectInput holds parameters for linting a project's CI/CD configuration.

Jump to

Keyboard shortcuts

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