From 069037891510bd7b1f6856f9c2c63cb0f812ca2f Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Fri, 8 May 2026 17:39:45 +0200 Subject: [PATCH] build: Add sonar settings/hooks --- .../build-scripts/pretool-secrets.sh | 5 ++++ .../build-scripts/prompt-secrets.sh | 5 ++++ .claude/settings.json | 28 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 .claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh create mode 100755 .claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh create mode 100644 .claude/settings.json diff --git a/.claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh b/.claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh new file mode 100755 index 00000000..24f537c2 --- /dev/null +++ b/.claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if ! command -v sonar &> /dev/null; then + exit 0 +fi +sonar hook claude-pre-tool-use diff --git a/.claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh b/.claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh new file mode 100755 index 00000000..2bb89ce2 --- /dev/null +++ b/.claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if ! command -v sonar &> /dev/null; then + exit 0 +fi +sonar hook claude-prompt-submit diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 00000000..81d3bbac --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,28 @@ +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Read", + "hooks": [ + { + "type": "command", + "command": ".claude/hooks/sonar-secrets/build-scripts/pretool-secrets.sh", + "timeout": 60 + } + ] + } + ], + "UserPromptSubmit": [ + { + "matcher": "*", + "hooks": [ + { + "type": "command", + "command": ".claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh", + "timeout": 60 + } + ] + } + ] + } +} \ No newline at end of file