Documentation
¶
Index ¶
- Variables
- func ConfigureAll(conf *config.Config) error
- func Disable(slug string) int
- func DisableAll(slugs []string) int
- func DisableCategory(cat api.Category) int
- func DisableRule(linter api.Linter, slug string) int
- func FindRules(slug string) []*api.Rule
- func GetCategory(slug string) (api.Category, bool)
- func GetLinter(slug string) (api.Linter, bool)
- func GetRule(slug string) *api.Rule
Constants ¶
This section is empty.
Variables ¶
var ByCategory = map[api.Category]api.Linter{ categories.VersionControl: versioncontrol.NewLinter(), categories.DependencyMgmt: dependencymgmt.NewLinter(), categories.ContinuousIntegration: ci.NewLinter(), categories.CodeQuality: codequality.NewLinter(), categories.Testing: testing.NewLinter(), categories.Custom: custom.NewLinter(), }
ByCategory contains a linter for each implemented category.
var Disabled = map[api.Category]api.Linter{}
Disabled contains all the linters for categories that have been disabled using Disable or DisableAll.
Functions ¶
func ConfigureAll ¶
Configures all the linters in linters.ByCategory with the given config.
func Disable ¶
Disables the linter for a specific category or rule by the category's or rule's slug. In case of a Rule slug, this should include the category name, e.g. 'version-control/code/git-no-big-files', such that the accompanying linter can be found and the rule can be disabled on it using linters.DisableRule. Returns the amount of linting rules disabled.
func DisableAll ¶
Disables the linters for all categories or rules referenced by the given slugs. Basically just a for-loop around linters.Disable() Returns the amount of linting rules disabled.
func DisableCategory ¶
DisableCategory disables the linter for a specific category, if a linter for that category is known in linters.ByCategory. Given a category `cat`, this method will remove linters.ByCategory[cat] and add it to linters.Disabled[cat]
func DisableRule ¶
DisableRule disables a rule on the linter by means of the rule's slug. The slug used here should be the same as one of the `linter.Rules()[i].Slug`
func FindRules ¶
FindRules finds all rules that match (start with) the given slug. E.g. `version-control/data` will return all the rules corresponding to data version control.
func GetCategory ¶
GetCategory parses the category from the given slug and returns the matched category and whether it matched. The category is the part of the slug up to the first `/`
Types ¶
This section is empty.