errors

package
v0.1.83 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutofixFunc added in v0.1.82

type AutofixFunc func() error

AutofixFunc applies an automatic fix for a single finding. It is expected to be idempotent: applying it to an already-fixed source must be a no-op and must not error.

type LintRuleErrorsList

type LintRuleErrorsList struct {
	// contains filtered or unexported fields
}

func NewLintRuleErrorsList added in v0.1.0

func NewLintRuleErrorsList() *LintRuleErrorsList

func (*LintRuleErrorsList) ContainsErrors added in v0.1.0

func (l *LintRuleErrorsList) ContainsErrors() bool

func (*LintRuleErrorsList) Error added in v0.1.0

func (*LintRuleErrorsList) Errorf added in v0.1.0

func (l *LintRuleErrorsList) Errorf(template string, a ...any) *LintRuleErrorsList

func (*LintRuleErrorsList) GetErrors added in v0.1.0

func (l *LintRuleErrorsList) GetErrors() []pkg.LinterError

func (*LintRuleErrorsList) GetFixes added in v0.1.82

func (l *LintRuleErrorsList) GetFixes() []func()

GetFixes returns one closure per collected finding that carries an automatic fix; findings without a fix are skipped. Each closure runs its fix and records the outcome back onto the stored finding: on success the finding is marked Fixed (so GetErrors drops it), on failure the error is stored in FixError (so GetErrors reports that the autofix could not be applied).

The closures are returned rather than executed so the caller — Manager.ApplyFixes, the single --fix entry point — controls when and in what order they run.

func (*LintRuleErrorsList) Warn added in v0.1.0

func (*LintRuleErrorsList) Warnf added in v0.1.0

func (l *LintRuleErrorsList) Warnf(template string, a ...any) *LintRuleErrorsList

func (*LintRuleErrorsList) WithFilePath added in v0.1.0

func (l *LintRuleErrorsList) WithFilePath(filePath string) *LintRuleErrorsList

func (*LintRuleErrorsList) WithFix added in v0.1.82

WithFix attaches an automatic fix to the next emitted finding. Findings that carry a fix are resolved through GetFixes when dmt runs with --fix.

func (*LintRuleErrorsList) WithLineNumber added in v0.1.0

func (l *LintRuleErrorsList) WithLineNumber(lineNumber int) *LintRuleErrorsList

func (*LintRuleErrorsList) WithLinterID added in v0.1.0

func (l *LintRuleErrorsList) WithLinterID(linterID string) *LintRuleErrorsList

func (*LintRuleErrorsList) WithMaxLevel added in v0.1.0

func (l *LintRuleErrorsList) WithMaxLevel(level *pkg.Level) *LintRuleErrorsList

func (*LintRuleErrorsList) WithModule added in v0.0.29

func (l *LintRuleErrorsList) WithModule(moduleID string) *LintRuleErrorsList

func (*LintRuleErrorsList) WithObjectID added in v0.0.29

func (l *LintRuleErrorsList) WithObjectID(objectID string) *LintRuleErrorsList

func (*LintRuleErrorsList) WithRule added in v0.1.0

func (l *LintRuleErrorsList) WithRule(ruleID string) *LintRuleErrorsList

func (*LintRuleErrorsList) WithValue added in v0.0.29

func (l *LintRuleErrorsList) WithValue(value any) *LintRuleErrorsList

type TestErrorsList added in v0.1.69

type TestErrorsList struct {
	// contains filtered or unexported fields
}

TestErrorsList is a separate error list for test results (not tied to linter).

func NewTestErrorsList added in v0.1.69

func NewTestErrorsList() *TestErrorsList

func (*TestErrorsList) AddTestResult added in v0.1.69

func (l *TestErrorsList) AddTestResult(text, got, expected string) *TestErrorsList

AddTestResult adds a structured test failure with got/expected comparison data.

func (*TestErrorsList) ContainsErrors added in v0.1.69

func (l *TestErrorsList) ContainsErrors() bool

func (*TestErrorsList) Error added in v0.1.69

func (l *TestErrorsList) Error(str string) *TestErrorsList

func (*TestErrorsList) Errorf added in v0.1.69

func (l *TestErrorsList) Errorf(template string, a ...any) *TestErrorsList

func (*TestErrorsList) GetErrors added in v0.1.69

func (l *TestErrorsList) GetErrors() []pkg.TestError

func (*TestErrorsList) WithModule added in v0.1.69

func (l *TestErrorsList) WithModule(moduleID string) *TestErrorsList

func (*TestErrorsList) WithTestGroup added in v0.1.69

func (l *TestErrorsList) WithTestGroup(group string) *TestErrorsList

func (*TestErrorsList) WithTestName added in v0.1.69

func (l *TestErrorsList) WithTestName(testName string) *TestErrorsList

Jump to

Keyboard shortcuts

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