Skip to content

Commit

Permalink
fix: use base lint
Browse files Browse the repository at this point in the history
  • Loading branch information
skynet2 committed Dec 30, 2024
1 parent 8512584 commit 6c49a00
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions scripts/check_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,9 @@ if [ ! $(command -v ${DOCKER_CMD}) ]; then
exit 0
fi

lint_tasks=(
"."
"component/profile/reader/file"
"component/event"
"component/healthchecks"
"component/credentialstatus"
"component/oidc/fosite"
)

run_lint() {
local task_dir=$1
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} \
-v $(pwd):/opt/workspace \
-w /opt/workspace/$task_dir ${GOLANGCI_LINT_IMAGE} \
golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
}

if [ "$LINT_CONCURRENTLY" = "true" ]; then
for task in "${lint_tasks[@]}"; do
run_lint "$task" &
done
wait
else
for task in "${lint_tasks[@]}"; do
run_lint "$task"
done
fi
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/profile/reader/file ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/event ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/healthchecks ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/credentialstatus ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'
${DOCKER_CMD} run --rm -e GOPROXY=${GOPROXY} -v $(pwd):/opt/workspace -w /opt/workspace/component/oidc/fosite ${GOLANGCI_LINT_IMAGE} golangci-lint run --timeout 5m --exclude-files '.*_test\.go'

0 comments on commit 6c49a00

Please sign in to comment.