Documentation
¶
Index ¶
- type Linter
- func (l Linter) DetermineEnabledRules(ctx context.Context) ([]string, error)
- func (l Linter) Lint(ctx context.Context) (report.Report, error)
- func (l Linter) WithAddedBundle(b bundle.Bundle) Linter
- func (l Linter) WithCustomRules(paths []string) Linter
- func (l Linter) WithCustomRulesFromFS(f fs.FS, rootPath string) Linter
- func (l Linter) WithDebugMode(debugMode bool) Linter
- func (l Linter) WithDisableAll(disableAll bool) Linter
- func (l Linter) WithDisabledCategories(disableCategory ...string) Linter
- func (l Linter) WithDisabledRules(disable ...string) Linter
- func (l Linter) WithEnableAll(enableAll bool) Linter
- func (l Linter) WithEnabledCategories(enableCategory ...string) Linter
- func (l Linter) WithEnabledRules(enable ...string) Linter
- func (l Linter) WithIgnore(ignore []string) Linter
- func (l Linter) WithInputModules(input *rules.Input) Linter
- func (l Linter) WithInputPaths(paths []string) Linter
- func (l Linter) WithMetrics(m metrics.Metrics) Linter
- func (l Linter) WithPrintHook(printHook print.Hook) Linter
- func (l Linter) WithProfiling(enabled bool) Linter
- func (l Linter) WithRootDir(rootDir string) Linter
- func (l Linter) WithUserConfig(cfg config.Config) Linter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
Linter stores data to use for linting.
func (Linter) DetermineEnabledRules ¶ added in v0.21.0
DetermineEnabledRules returns the list of rules that are enabled based on the supplied configuration. This makes use of the Rego and Go rule settings to produce a single list of the rules that are to be run on this linter instance.
func (Linter) WithAddedBundle ¶
WithAddedBundle adds a bundle of rules and data to include in evaluation.
func (Linter) WithCustomRules ¶
WithCustomRules adds custom rules for evaluation, from the Rego (and data) files provided at paths.
func (Linter) WithCustomRulesFromFS ¶ added in v0.14.0
WithCustomRulesFromFS adds custom rules for evaluation from a filesystem implementing the fs.FS interface. A rootpath within the filesystem must also be specified. Note, _test.rego files will be ignored.
func (Linter) WithDebugMode ¶ added in v0.8.0
WithDebugMode enables debug mode.
func (Linter) WithDisableAll ¶
WithDisableAll disables all rules when set to true. This overrides configuration provided in file.
func (Linter) WithDisabledCategories ¶
WithDisabledCategories disables provided categories of rules. This overrides configuration provided in file.
func (Linter) WithDisabledRules ¶
WithDisabledRules disables provided rules. This overrides configuration provided in file.
func (Linter) WithEnableAll ¶
WithEnableAll enables all rules when set to true. This overrides configuration provided in file.
func (Linter) WithEnabledCategories ¶
WithEnabledCategories enables provided categories of rules. This overrides configuration provided in file.
func (Linter) WithEnabledRules ¶
WithEnabledRules enables provided rules. This overrides configuration provided in file.
func (Linter) WithIgnore ¶ added in v0.5.0
WithIgnore excludes files matching patterns. This overrides configuration provided in file.
func (Linter) WithInputModules ¶ added in v0.8.0
WithInputModules sets the input modules to lint. This is used for programmatic access, where you don't necessarily want to lint *files*.
func (Linter) WithInputPaths ¶ added in v0.8.0
WithInputPaths sets the inputPaths to lint. Note that these will be filtered according to the ignore options.
func (Linter) WithMetrics ¶ added in v0.9.0
WithMetrics enables metrics collection.
func (Linter) WithPrintHook ¶ added in v0.10.0
func (Linter) WithProfiling ¶ added in v0.10.0
WithProfiling enables profiling metrics.
func (Linter) WithRootDir ¶ added in v0.20.0
WithRootDir sets the root directory for the linter. A door directory or prefix can be use to resolve relative paths referenced in the linter configuration with absolute file paths or URIs.