Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARGO-120 Publish golangci-lint report to SonarQube #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus/modules/build.star
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build_env():
env |= next_env()
env |= {
"DEPLOY_PULL_REQUEST": "true",
"BUILD_ARGUMENTS": "--build-cache"
"BUILD_ARGUMENTS": "lintGoCode --build-cache"
}
return env

Expand Down
12 changes: 11 additions & 1 deletion sonar-go-to-slang/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (isCi) {
callMake("build")
}

tasks.register<Exec>("lintGoCode") {
val lintGoCode = tasks.register<Exec>("lintGoCode") {
description = "Run an external Go linter."
group = "verification"

Expand Down Expand Up @@ -106,6 +106,16 @@ if (isCi) {
dependsOn("testGoCode")
}

tasks.named("check") {
dependsOn(lintGoCode)
}

rootProject.tasks.named("sonar") {
// As lintGoCode produces a report to be ingested by SonarQube, we need to add an explicit dependency to it.
// See https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner-for-gradle/#task-dependencies
dependsOn(lintGoCode)
}

spotless {
go {
gofmt("go$goVersion")
Expand Down
Loading