ci: run golangci-lint for each Go module

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
Austin Vazquez
2025-12-22 16:18:43 -06:00
parent fba74ac758
commit c8aaeea285

View File

@@ -15,7 +15,11 @@ if pkg-config 'libsystemd' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald"
fi
echo -e "\n\033[0;36mINFO\033[0m Start validation with golang-ci-lint"
# Note: exclude github.com/docker/docker/man as it contains no Go code.
mods=($(find . -name "go.mod" -type f -exec dirname {} \; | grep -v "man" | sort -u))
for mod in "${mods[@]}"; do
pushd "${mod}" > /dev/null
echo -e "\n\033[0;36mINFO\033[0m Start validation for module '${mod}' with golang-ci-lint"
# TODO use --out-format=junit-xml and store artifacts
# shellcheck disable=SC2086
@@ -25,3 +29,5 @@ GOGC=75 golangci-lint run \
--build-tags="${DOCKER_BUILDTAGS}" \
--verbose \
--config "${REPODIR}/.golangci.yml"
popd > /dev/null
done