ci: upstream dep-assert and nomenclature from server/v2 (#19703)

This commit is contained in:
Julien Robert
2024-03-08 17:00:09 +00:00
committed by GitHub
parent 2bfc037a07
commit 0f5314c031
6 changed files with 29 additions and 16 deletions
+20 -3
View File
@@ -2,14 +2,14 @@
set -o errexit
SIMAPP_REGEX="cosmossdk.io/simapp"
CWD=$(pwd)
# no simapp imports in modules
SIMAPP_REGEX="cosmossdk.io/simapp"
find . -type f -name 'go.mod' -print0 | while IFS= read -r -d '' file
do
d=$(dirname "$file")
if [[ "$d" =~ \./simapp$|\./tests* ]]; then
if [[ "$d" =~ \./simapp$|\./simapp/v2$|\./tests* ]]; then
continue
fi
@@ -18,3 +18,20 @@ do
exit 1
fi
done
# no runtime/v2 or server/v2 imports in x/ modules
RUNTIMEV2_REGEX="cosmossdk.io/runtime/v2"
SEVERV2_REGEX="cosmossdk.io/server/v2"
find ./x/ -type f -name 'go.mod' -print0 | while IFS= read -r -d '' file
do
d=$(dirname "$file")
if cd "$CWD/$d" && go list -test -f '{{ .Imports }}' ./... | grep -q -E "${RUNTIMEV2_REGEX}"; then
echo "${d} has a dependency on runtime/v2!"
exit 1
fi
if cd "$CWD/$d" && go list -test -f '{{ .Imports }}' ./... | grep -q -E "${SEVERV2_REGEX}"; then
echo "${d} has a dependency on server/v2!"
exit 1
fi
done