MCPcopy Create free account
hub / github.com/vale-cli/vale / AddRuleFromFile

Method AddRuleFromFile

internal/check/manager.go:89–95  ·  view source on GitHub ↗

AddRuleFromFile adds the given rule to the manager.

(name, path string)

Source from the content-addressed store, hash-verified

87
88// AddRuleFromFile adds the given rule to the manager.
89func (mgr *Manager) AddRuleFromFile(name, path string) error {
90 content, err := os.ReadFile(path)
91 if err != nil {
92 return core.NewE100("ReadFile", err)
93 }
94 return mgr.addCheck(content, name, path)
95}
96
97// Rules are all of the Manager's compiled `Rule`s.
98func (mgr *Manager) Rules() map[string]Rule {

Callers 3

spellingFunction · 0.95
compileRuleFunction · 0.95
runRuleFunction · 0.80

Calls 2

addCheckMethod · 0.95
NewE100Function · 0.92

Tested by

no test coverage detected