Skip to content
Snippets Groups Projects
Verified Commit e1bb6ff8 authored by Bob Van Landuyt :neckbeard:'s avatar Bob Van Landuyt :neckbeard: 😎
Browse files

feat(lint): allow configuring golangci_lint timeout

This allows specifying a timeout for golangci_lint. The default
remains 5m.

We shouldn't really be running into this, so it's advisable to look
into why we're hitting this timeout when we do. But as a workaround
it's handy to have this configurable.
parent cb786c6b
No related branches found
No related tags found
No related merge requests found
Pipeline #24673903 passed
Loading
Loading
@@ -15,4 +15,6 @@ include:
- project: 'gitlab-com/gl-infra/common-ci-tasks'
ref: v2.49.2 # renovate:managed
file: 'golangci-lint.yml'
inputs:
golangci_lint_timeout: 5m # optionally specify a separate timeout
```
Loading
Loading
@@ -9,6 +9,8 @@ spec:
default: validate
docker_hub_host:
default: docker.io
golangci_lint_timeout:
default: 5m
---
 
golangci_lint:
Loading
Loading
@@ -25,7 +27,7 @@ golangci_lint:
# and print linting issues to stdout in the format: path/to/file:line description
# https://docs.gitlab.com/ee/development/go_guide/#automatic-linting
export GOLANG_VERSION="${GL_ASDF_GOLANG_VERSION}"; export GOTOOLCHAIN="go${GL_ASDF_GOLANG_VERSION}";
golangci-lint run --timeout 5m --out-format code-climate |
golangci-lint run --timeout $[[ inputs.golangci_lint_timeout ]] --out-format code-climate |
tee "gl-code-quality-report.json" |
jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
after_script: |
Loading
Loading
Loading
Loading
@@ -6,6 +6,9 @@ spec:
default: release
docker_hub_host:
default: docker.io
golangci_lint_timeout:
default: 5m
---
include:
# Keep the following items in alphabetical order
Loading
Loading
@@ -23,6 +26,7 @@ include:
inputs:
stage: $[[ inputs.validate_stage ]]
docker_hub_host: $[[ inputs.docker_hub_host ]]
golangci_lint_timeout: $[[ inputs.golangci_lint_timeout ]]
 
- local: goreleaser.yml
inputs:
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment