diff options
Diffstat (limited to 'nvim/scripts/sonarqube.sh')
| -rwxr-xr-x | nvim/scripts/sonarqube.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nvim/scripts/sonarqube.sh b/nvim/scripts/sonarqube.sh new file mode 100755 index 0000000..ef1be89 --- /dev/null +++ b/nvim/scripts/sonarqube.sh | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | set -eu | ||
| 4 | |||
| 5 | SONAR_TOKEN=$(awk -F= '/^sonar.token=/ {print $2}' /opt/homebrew/etc/sonar-scanner.properties) | ||
| 6 | SONAR_HOST_URL=$(awk -F= '/^sonar.host.url=/ {print $2}' /opt/homebrew/etc/sonar-scanner.properties) | ||
| 7 | PROJECT_KEY=$(awk -F= '/^sonar.projectKey=/ {print $2}' ./sonar-project.properties) | ||
| 8 | |||
| 9 | curl -s \ | ||
| 10 | -u "$SONAR_TOKEN:" \ | ||
| 11 | "$SONAR_HOST_URL/api/issues/search?componentKeys=$PROJECT_KEY&statuses=OPEN" | | ||
| 12 | jq -r '.issues[] | "\(.component | sub("^[^:]+:"; "")):\(.line // 1): [\(.severity)] \(.message | gsub("\n"; " ")) (\(.author))"' | ||
| 13 | |||
