Complete forge delivery regression coverage
This commit is contained in:
@@ -226,6 +226,33 @@ func checkImportDirections(packages []listedPackage) error {
|
||||
}
|
||||
visit(modulePath + "/buildinfo")
|
||||
|
||||
for _, root := range []string{
|
||||
modulePath + "/internal/delivery",
|
||||
modulePath + "/internal/forge",
|
||||
modulePath + "/internal/artifact",
|
||||
} {
|
||||
seen := make(map[string]bool)
|
||||
var visitDelivery func(string)
|
||||
visitDelivery = func(path string) {
|
||||
if seen[path] {
|
||||
return
|
||||
}
|
||||
seen[path] = true
|
||||
if path == modulePath+"/internal/gitea" {
|
||||
violations = append(violations, fmt.Sprintf("shared package %s depends on Gitea adapter", root))
|
||||
return
|
||||
}
|
||||
pkg, ok := byPath[path]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
for _, imported := range pkg.Imports {
|
||||
visitDelivery(imported)
|
||||
}
|
||||
}
|
||||
visitDelivery(root)
|
||||
}
|
||||
|
||||
if len(violations) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user