checkcmd

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath added in v0.0.15

func ConfigPath(repoRoot string) string

ConfigPath returns the expected check config file path for a repo.

func FailedStepName

func FailedStepName(results []StepResult) string

FailedStepName returns the first step that failed (not skipped).

func FormatFailureSummary

func FormatFailureSummary(results []StepResult, runErr error) string

FormatFailureSummary builds a readable failure summary for CLI output.

func InitConfigTemplate

func InitConfigTemplate(repoRoot string) (string, error)

InitConfigTemplate writes `.fastgit/check.yaml` when missing.

func New

func New() *redant.Command

New creates the check command group.

Types

type Config

type Config struct {
	Steps []Step
}

Config holds check pipeline configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the built-in pipeline for Go projects.

func ForCommit added in v0.0.14

func ForCommit(cfg *Config) *Config

ForCommit returns a lighter pipeline for the commit flow (skips test step).

func LoadConfig

func LoadConfig(repoRoot string) *Config

LoadConfig loads `.fastgit/check.yaml`. Returns nil Config if the file does not exist.

type RunOptions

type RunOptions struct {
	StagedOnly bool
	Fix        bool
	DryRun     bool
	RepoRoot   string
}

RunOptions controls check execution.

type Step

type Step struct {
	Name        string
	Command     string
	FixCommand  string
	Fixable     bool
	Optional    bool
	Description string
}

Step defines one quality gate step.

type StepResult

type StepResult struct {
	Step    Step
	Skipped bool
	Reason  string
	Err     error
	Output  string
}

StepResult holds the outcome of one step.

func Run

func Run(ctx context.Context, cfg Config, opts RunOptions) ([]StepResult, error)

Run executes the check pipeline.

Jump to

Keyboard shortcuts

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