runner

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 18 Imported by: 0

README

Crie

The crie package is the core runtime that orchestrates the execution of linters

Documentation

Overview

Package runner contains the logic to run the linters

Package runner contains the logic to run the linters

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(list []string, expect bool, f func(string) bool) []string

Filter to include (expect == true) or exclude (expect == false) the list of files (list) based on the filter function (f)

Types

type LintType

type LintType int

LintType indicates which linter to retrieve for a language (formatter or checker).

const (
	// LintTypeFmt selects the formatter linter for a language.
	LintTypeFmt LintType = iota
	// LintTypeChk selects the checker linter for a language.
	LintTypeChk
)

Supported LintType values for selecting a linter.

func (LintType) String

func (lt LintType) String() string

type LinterMatch added in v1.0.6

type LinterMatch struct {
	FileMatch *regexp.Regexp
	Fmt       linter.Linter
	Chk       linter.Linter
}

LinterMatch is used to associate a file pattern with the relevant tools to check and format

func (*LinterMatch) GetLinter added in v1.0.6

func (l *LinterMatch) GetLinter(which LintType) linter.Linter

GetLinter returns the linter associated with the provided LintType (either the formatter or the checker) for this language.

type NamedMatches added in v1.0.6

type NamedMatches map[string]LinterMatch

NamedMatches store the name for a LinterMatch to make referencing them easier

func (NamedMatches) Show added in v1.0.6

func (s NamedMatches) Show(w io.Writer) error

Show all linters and their associated file types

type Options

type Options struct {
	Continue      bool   `json:"continue,omitzero" yaml:"continue"`
	Passes        bool   `json:"passes,omitzero" yaml:"passes"`
	GitTarget     string `json:"gitTarget,omitzero" yaml:"gitTarget"`
	GitDiff       bool   `json:"gitDiff,omitzero" yaml:"gitDiff"`
	Only          string `json:"only,omitzero" yaml:"only"`
	StrictLogging bool   `json:"-" yaml:"-"`
}

Options are the core flags and settings to change execution

type RunConfiguration

type RunConfiguration struct {
	Options      Options
	Ignore       *regexp.Regexp
	NamedMatches NamedMatches
}

RunConfiguration is the entire working set of information to process a project

func (*RunConfiguration) NoStandards

func (s *RunConfiguration) NoStandards(w io.Writer) error

NoStandards runs all fmt exec commands in matchers and in always fmt

func (*RunConfiguration) Run

func (s *RunConfiguration) Run(ctx context.Context, lintType LintType) error

Run is the generic way to run everything based on the package configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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