AddRuleFromFile adds the given rule to the manager.
(name, path string)
| 87 | |
| 88 | // AddRuleFromFile adds the given rule to the manager. |
| 89 | func (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. |
| 98 | func (mgr *Manager) Rules() map[string]Rule { |
no test coverage detected