aboutsummaryrefslogtreecommitdiff
path: root/nvim/scripts
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-03-25 07:08:57 +0100
committerThomas Schmucker <ts@its1.de>2026-03-25 07:08:57 +0100
commite99756d1d5acb6805003b403985ee0a2a253bf26 (patch)
tree7dac1f53da9f2f231d4457dd56589b3a514e841d /nvim/scripts
parent9f6461c5b1cb6754b130b30dfe9ba50fd1fcf9cb (diff)
downloaddotfiles-e99756d1d5acb6805003b403985ee0a2a253bf26.tar.gz
dotfiles-e99756d1d5acb6805003b403985ee0a2a253bf26.tar.bz2
dotfiles-e99756d1d5acb6805003b403985ee0a2a253bf26.zip
Neovim: Sonarqube Unterstützung hinzugefügt
Diffstat (limited to 'nvim/scripts')
-rw-r--r--nvim/scripts/sonarqube.md28
-rwxr-xr-xnvim/scripts/sonarqube.sh13
2 files changed, 41 insertions, 0 deletions
diff --git a/nvim/scripts/sonarqube.md b/nvim/scripts/sonarqube.md
new file mode 100644
index 0000000..d276053
--- /dev/null
+++ b/nvim/scripts/sonarqube.md
@@ -0,0 +1,28 @@
1# Installieren
2
3```sh
4brew install sonar-scanner
5```
6
7# Token erstellen
8
91. Mit VPN verbinden.
102. Bei [Sonarqube] anmelden.
113. Auf "Account" -> "My Account" -> "Security" klicken
124. Einen neuen Token erstellen:
13 Name: "command-line"
14 Type: "User Token"
15 Expires in: "1 year"
165. Token und Host-URL in `/opt/homebrew/etc/sonar-scanner.properties` einfügen:
17```conf
18sonar.token=<token>
19sonar.host.url=https://sonarqube.dev.up2parts.com
20```
21
22# Sonarqube ausführen
23
24Im Projektverzeichnis `sonar-scaner` ausführen.
25Sonarqube muss für das Projekt mit einer Datei `sonar-project.properties` konfiguriert sein.
26
27[Sonarqube]: https://sonarqube.dev.up2parts.com/
28
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
3set -eu
4
5SONAR_TOKEN=$(awk -F= '/^sonar.token=/ {print $2}' /opt/homebrew/etc/sonar-scanner.properties)
6SONAR_HOST_URL=$(awk -F= '/^sonar.host.url=/ {print $2}' /opt/homebrew/etc/sonar-scanner.properties)
7PROJECT_KEY=$(awk -F= '/^sonar.projectKey=/ {print $2}' ./sonar-project.properties)
8
9curl -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