runner

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 14 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 Language

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

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

func (*Language) GetLinter

func (l *Language) GetLinter(which LintType) (linter.Linter, error)

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

type Languages

type Languages map[string]*Language

Languages store the name to a singular language configuration within crie

func (Languages) Show

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

Show to print all languages chkConf fmt and always commands

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 Options

type Options struct {
	Continue      bool   `json:"continue" yaml:"continue"`
	Passes        bool   `json:"passes" yaml:"passes"`
	GitTarget     string `json:"gitTarget" yaml:"gitTarget"`
	GitDiff       bool   `json:"gitDiff" yaml:"gitDiff"`
	Only          string `json:"only" 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
	Languages Languages
}

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

func (*RunConfiguration) GetLanguage

func (s *RunConfiguration) GetLanguage(only string) (*Language, error)

GetLanguage returns the Language configuration by its name or an error if it does not exist.

func (*RunConfiguration) NoStandards

func (s *RunConfiguration) NoStandards() error

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

func (*RunConfiguration) Run

func (s *RunConfiguration) Run(lintType LintType) error

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

Jump to

Keyboard shortcuts

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