Fix panic and rule loss in list parsing/resolution (#3905)
* Fix panic on empty inclusion attribute, rule loss in selective inclusion and other bugs * Exercise domain/list-name validators in tests * Consolidate parsed list state into ParsedList and simplify inclusion parsing Co-authored-by: Loyalsoldier <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Loyalsoldier <[email protected]>
This commit is contained in:
1 parent
4eb9b28041
commit
b49404a24e
3 files changed
+277
-52
No files matched your search
@@ -143,20 +143,26 @@ func run() error {
|
||||
exportListSlice = []string{"_all_"}
|
||||
}
|
||||
|
||||
failedCount := 0
|
||||
for _, eplistname := range exportListSlice {
|
||||
if strings.EqualFold(eplistname, "_all_") {
|
||||
if err := exportAll(filepath.Base(*inputData)+"_plain.yml", geoSites); err != nil {
|
||||
fmt.Printf("[Error] failed to exportAll: %v\n", err)
|
||||
failedCount++
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
if err := exportSite(eplistname, geoSites); err != nil {
|
||||
fmt.Printf("[Error] failed to exportSite: %v\n", err)
|
||||
failedCount++
|
||||
continue
|
||||
}
|
||||
}
|
||||
fmt.Printf("list: %q has been exported successfully\n", eplistname)
|
||||
}
|
||||
if failedCount > 0 {
|
||||
return fmt.Errorf("%d list(s) failed to be exported", failedCount)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user