Add profile loading and process execution
This commit is contained in:
@@ -108,7 +108,7 @@ func checkImportDirections(packages []listedPackage) error {
|
||||
var violations []string
|
||||
|
||||
for _, pkg := range packages {
|
||||
if !strings.HasPrefix(pkg.ImportPath, modulePath+"/internal/") {
|
||||
if !isInternalPackage(pkg.ImportPath) {
|
||||
continue
|
||||
}
|
||||
for _, imported := range pkg.Imports {
|
||||
@@ -149,6 +149,11 @@ func checkImportDirections(packages []listedPackage) error {
|
||||
return errors.New(strings.Join(violations, "\n"))
|
||||
}
|
||||
|
||||
func isInternalPackage(path string) bool {
|
||||
return strings.HasPrefix(path, modulePath+"/internal/") ||
|
||||
strings.HasPrefix(path, modulePath+"/") && strings.Contains(strings.TrimPrefix(path, modulePath), "/internal/")
|
||||
}
|
||||
|
||||
func forbiddenRuntimeDependency(path string) bool {
|
||||
for _, part := range strings.Split(strings.ToLower(path), "/") {
|
||||
switch part {
|
||||
|
||||
Reference in New Issue
Block a user