MCPcopy Create free account
hub / github.com/checkmake/checkmake / Validate

Function Validate

validator/validator.go:23–35  ·  view source on GitHub ↗

Validate let's you validate a passed in Makefile with the provided config

(makefile parser.Makefile, cfg *config.Config)

Source from the content-addressed store, hash-verified

21
22// Validate let's you validate a passed in Makefile with the provided config
23func Validate(makefile parser.Makefile, cfg *config.Config) (ret rules.RuleViolationList) {
24 rules := rules.GetRegisteredRules()
25
26 for name, rule := range rules {
27 logger.Debug(fmt.Sprintf("Running rule '%s'...", name))
28 ruleConfig := cfg.GetRuleConfig(name)
29 if ruleConfig["disabled"] != "true" {
30 ret = append(ret, rule.Run(makefile, ruleConfig)...)
31 }
32 }
33
34 return
35}

Callers 5

TestDefaultFormatterFunction · 0.92
TestJSONFormatterFunction · 0.92
TestCustomFormatterFunction · 0.92
runCheckmakeFunction · 0.92
TestValidatorFunction · 0.85

Calls 4

GetRegisteredRulesFunction · 0.92
DebugFunction · 0.92
GetRuleConfigMethod · 0.80
RunMethod · 0.65

Tested by 4

TestDefaultFormatterFunction · 0.74
TestJSONFormatterFunction · 0.74
TestCustomFormatterFunction · 0.74
TestValidatorFunction · 0.68