add aliases validation

This commit is contained in:
guiyomu-dev
2026-01-29 07:19:53 +01:00
parent 4d9c6e75cd
commit d0987cb9e9
2 changed files with 14 additions and 0 deletions

View File

@@ -63,6 +63,10 @@ func ParseNIPFile(filePath string) (Rules, error) {
return nil, fmt.Errorf("error reading %s file at line %d: %w", filePath, lineNumber, err)
}
if err := rule.ValidateStats(); err != nil {
return nil, fmt.Errorf("error validating rule on [%s:%d]: %w", filePath, lineNumber, err)
}
// We evaluate all the rules at startup to ensure no format errors, if there is a format error we will throw it now instead of during runtime
_, err = rule.Evaluate(dummyItem)
if err != nil {