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 <10487845+Loyalsoldier@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
This commit is contained in:
Copilot
2026-08-04 18:22:31 +08:00
committed by GitHub
parent 4eb9b28041
commit b49404a24e
3 changed files with 277 additions and 52 deletions
+6
View File
@@ -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
}