Skip to content

Commit

Permalink
Add a GetConfig method (#387)
Browse files Browse the repository at this point in the history
* Update rule.go

* fix: fix lint and add GetConfig to interface
  • Loading branch information
hugo-syn authored and rhysd committed Feb 9, 2024
1 parent 86df2f6 commit 85a89db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func (r *RuleBase) SetConfig(cfg *Config) {
r.config = cfg
}

// GetConfig returns the config of the rule
func (r *RuleBase) GetConfig() *Config {
return r.config
}

// Rule is an interface which all rule structs must meet.
type Rule interface {
Pass
Expand All @@ -98,4 +103,5 @@ type Rule interface {
Description() string
EnableDebug(out io.Writer)
SetConfig(cfg *Config)
GetConfig() *Config
}

0 comments on commit 85a89db

Please sign in to comment.