config

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 11 Imported by: 24

Documentation

Overview

Package config implements revive's configuration data structures and related methods.

Index

Constants

View Source
const DefaultConfidence = 0.8

DefaultConfidence is the default confidence level for revive's linter.

Variables

This section is empty.

Functions

func AllRules added in v1.16.0

func AllRules() []lint.Rule

AllRules returns a copy of the list of all rules registered in revive.

func Default added in v1.16.0

func Default() *lint.Config

Default returns the default linter configuration, used when no configuration is provided.

func DefaultRules added in v1.16.0

func DefaultRules() []lint.Rule

DefaultRules returns a copy of the list of rules that are enabled by default.

func EnabledRules added in v1.16.0

func EnabledRules(config *lint.Config) []lint.Rule

EnabledRules returns the rules that are enabled in the given configuration.

func GetConfig

func GetConfig(configPath string) (*lint.Config, error)

GetConfig yields the configuration.

func GetFormatter

func GetFormatter(formatterName string) (lint.Formatter, error)

GetFormatter yields the formatter for lint failures.

func GetLintingRules

func GetLintingRules(config *lint.Config, extraRules []lint.Rule) ([]lint.Rule, error)

GetLintingRules yields the linting rules that must be applied by the linter.

func Normalize added in v1.16.0

func Normalize(config *lint.Config)

Normalize fills in default rule entries (according to the EnableAllRules / EnableDefaultRules options) and propagates the configured severity to rules and directives that don't define their own.

Types

This section is empty.

Jump to

Keyboard shortcuts

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