1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-21 17:16:40 +02:00
revive/revivelib/extra_rule.go
Bernardo Heynemann 318db94210
Separating lib from cli (#655)
* Separating lib from cli

* Renamed NewRevive to New

* Added GetLintFailures helper function

* Moved formatter to call to format since that's when it's needed

* makes fields of Revive struct non-public

* minor modifs in tests: remove unnamed constats

* Added lint package management to lint command

* README message for using revive as a library

* README formatting

* Removed unused method

* Slightly improved wording in README

* Handling format errors

* Renaming file to better reflect intent

* Refactoring pattern usage

* README heads

* renames excludePaths into excludePatterns

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-03-29 17:31:52 +02:00

18 lines
407 B
Go

package revivelib
import "github.com/mgechev/revive/lint"
// ExtraRule configures a new rule to be used with revive.
type ExtraRule struct {
Rule lint.Rule
DefaultConfig lint.RuleConfig
}
// NewExtraRule returns a configured extra rule.
func NewExtraRule(rule lint.Rule, defaultConfig lint.RuleConfig) ExtraRule {
return ExtraRule{
Rule: rule,
DefaultConfig: defaultConfig,
}
}