Extend rule structure and nip rule parser (#16)

This commit is contained in:
Arto Simonyan
2024-05-01 01:34:57 +03:00
committed by GitHub
parent e27064213f
commit 345e37bbf9
5 changed files with 10 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ var (
propertyNameRegex = regexp.MustCompile(`\[(.*)\]`)
)
func ParseLine(line string) (Rule, error) {
func ParseLine(line string, filename string, linenum int) (Rule, error) {
line = lineCleanup(line)
if line == "" {
return Rule{}, errEmptyLine
@@ -46,6 +46,9 @@ func ParseLine(line string) (Rule, error) {
Properties: properties,
Stats: stats,
MaxQuantity: maxQuantity,
Filename: filename,
LineNumber: linenum,
Enabled: true,
}, nil
}