Skip to content

Commit 7291462

Browse files
committed
Address issue #681
custom functions are now supported in reports.
1 parent 274fc4b commit 7291462

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

cmd/spectral_report.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,11 @@ func GetSpectralReportCommand() *cobra.Command {
129129
}
130130

131131
functionsFlag, _ := cmd.Flags().GetString("functions")
132-
var customFunctions map[string]model.RuleFunction
132+
customFunctions, _ := LoadCustomFunctions(functionsFlag, true)
133133

134134
// if ruleset has been supplied, lets make sure it exists, then load it in
135135
// and see if it's valid. If so - let's go!
136136
if rulesetFlag != "" {
137-
138-
customFunctions, _ = LoadCustomFunctions(functionsFlag, true)
139137
var rsErr error
140138
selectedRS, rsErr = BuildRuleSetFromUserSuppliedLocation(rulesetFlag, defaultRuleSets, remoteFlag)
141139
if rsErr != nil {

cmd/vacuum_report.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,12 @@ func GetVacuumReportCommand() *cobra.Command {
145145
}
146146

147147
functionsFlag, _ := cmd.Flags().GetString("functions")
148-
var customFunctions map[string]model.RuleFunction
148+
customFunctions, _ := LoadCustomFunctions(functionsFlag, true)
149149

150150
// if ruleset has been supplied, lets make sure it exists, then load it in
151151
// and see if it's valid. If so - let's go!
152152
if rulesetFlag != "" {
153153

154-
customFunctions, _ = LoadCustomFunctions(functionsFlag, true)
155-
156154
var rsErr error
157155
selectedRS, rsErr = BuildRuleSetFromUserSuppliedLocation(rulesetFlag, defaultRuleSets, remoteFlag)
158156
if rsErr != nil {

0 commit comments

Comments
 (0)