Migrate facade tests to the new configuration contracts
This commit is contained in:
@@ -239,6 +239,11 @@ func publicSurfaceViolations(pkg *types.Package, modulePath string) []string {
|
||||
case *types.Named:
|
||||
inspectTypeArgs(value.TypeArgs(), where)
|
||||
if isInternalPackage(value.Obj().Pkg(), modulePath) {
|
||||
if isSharedSettingsType(value.Obj(), modulePath) {
|
||||
inspect(value.Underlying(), where)
|
||||
inspectMethods(value, where)
|
||||
return
|
||||
}
|
||||
record(where, value)
|
||||
return
|
||||
}
|
||||
@@ -343,6 +348,18 @@ func publicSurfaceViolations(pkg *types.Package, modulePath string) []string {
|
||||
return compactStrings(violations)
|
||||
}
|
||||
|
||||
func isSharedSettingsType(obj *types.TypeName, modulePath string) bool {
|
||||
if obj == nil || obj.Pkg() == nil || obj.Pkg().Path() != modulePath+"/internal/settings" {
|
||||
return false
|
||||
}
|
||||
switch obj.Name() {
|
||||
case "Settings", "CollectionSettings", "BackendSettings", "ProfileSettings", "PromptSettings", "PromptInputSettings", "PromptMessageSettings", "PromptCacheControlSettings", "PromptOutputSettings", "BackendSmokeTestConfig", "ReachabilityProbeConfig", "AuthenticationProbeConfig":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isInternalPackage(pkg *types.Package, modulePath string) bool {
|
||||
return pkg != nil && strings.HasPrefix(pkg.Path(), modulePath+"/internal/")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user