From e99756d1d5acb6805003b403985ee0a2a253bf26 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 25 Mar 2026 07:08:57 +0100 Subject: Neovim: Sonarqube Unterstützung hinzugefügt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/config/usercmds.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 nvim/lua/config/usercmds.lua (limited to 'nvim/lua/config/usercmds.lua') diff --git a/nvim/lua/config/usercmds.lua b/nvim/lua/config/usercmds.lua new file mode 100644 index 0000000..e7dd220 --- /dev/null +++ b/nvim/lua/config/usercmds.lua @@ -0,0 +1,31 @@ +local function run_sonar() + local exe = vim.fn.exepath("sonar-scanner") + + if exe == "" then + vim.notify("sonar-scanner nicht im PATH gefunden", vim.log.levels.ERROR) + return + end + + if vim.fn.executable(exe) == 0 then + vim.notify("sonar-scanner ist nicht ausführbar", vim.log.levels.ERROR) + return + end + + -- vim.cmd("!" .. exe) + vim.cmd("botright split | terminal " .. exe) + vim.cmd("norm G") +end + +local function load_sonar_issues() + local cmd = vim.fn.stdpath("config") .. "/scripts/sonarqube.sh" + + vim.fn.setqflist({}, " ", { + title = "SonarQube Issues", + lines = vim.fn.systemlist(cmd), + }) + + vim.cmd("copen") +end + +vim.api.nvim_create_user_command("SonarScan", run_sonar, {}) +vim.api.nvim_create_user_command("SonarIssues", load_sonar_issues, {}) -- cgit v1.3