static

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package static reads the modules to lint from a working tree: the full source as committed, rendered the way Deckhouse would render it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Source)

Option customizes a Source at construction time.

func WithMatrix

func WithMatrix(enabled bool, limit int) Option

WithMatrix enables matrix mode with the given per-module combination limit. A non-positive limit falls back to the matrix package default. It is the programmatic equivalent of the --matrix / --matrix-limit flags, and lets callers (e.g. tests running cases in parallel) opt in without touching process-global flags.

type Source

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

Source reads modules from a directory on disk.

func NewSource

func NewSource(dir string, opts ...Option) *Source

NewSource lints every module found under dir.

func (*Source) Close

func (s *Source) Close()

Close has nothing to release: the modules are the caller's own files.

func (*Source) ConfigDir

func (s *Source) ConfigDir() string

ConfigDir is the linted directory itself: .dmtlint.yaml is looked up from the tree it configures.

func (*Source) Scopes

func (s *Source) Scopes() []scopes.Scope

func (*Source) Targets

func (s *Source) Targets(
	_ context.Context,
	cfg *config.RootConfig,
	errorList *errors.LintRuleErrorsList,
	yield func(manager.Target) bool,
) error

Targets walks the tree for modules and builds each one. A module that cannot be read is reported as a finding and skipped, not returned as an error: one broken module must not cost the caller the findings of every other.

Modules are handed to yield as they are built rather than collected: under --matrix one module becomes many renders, and yield blocks while the linters are busy, so only a bounded number of them is ever resident.

Jump to

Keyboard shortcuts

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