Fixed filter allow condition with tag and etags

dev
Ice3man543 2021-07-01 21:02:57 +05:30
parent 12deece54b
commit d57d1ecae2
1 changed files with 9 additions and 8 deletions

View File

@ -26,6 +26,14 @@ var ErrExcluded = errors.New("the template was excluded")
//
// It returns true if the tag is specified, or false.
func (t *tagFilter) match(tag, author, severity string) (bool, error) {
matchedAny := false
if len(t.allowedTags) > 0 {
_, ok := t.allowedTags[tag]
if !ok {
return false, nil
}
matchedAny = true
}
_, ok := t.block[tag]
if ok {
if _, allowOk := t.matchAllows[tag]; allowOk {
@ -33,14 +41,6 @@ func (t *tagFilter) match(tag, author, severity string) (bool, error) {
}
return false, ErrExcluded
}
matchedAny := false
if len(t.allowedTags) > 0 {
_, ok = t.allowedTags[tag]
if !ok {
return false, nil
}
matchedAny = true
}
if len(t.authors) > 0 {
_, ok = t.authors[author]
if !ok {
@ -77,6 +77,7 @@ func (config *Config) createTagFilter() *tagFilter {
if _, ok := filter.allowedTags[val]; !ok {
filter.allowedTags[val] = struct{}{}
}
delete(filter.block, val)
}
}
for _, tag := range config.Severities {