Skip to content

CLI-43: Add -g/--global flag to sonar integrate claude#54

Merged
kirill-knize-sonarsource merged 3 commits intomasterfrom
feature/CLI-43-global-integrate
Feb 27, 2026
Merged

CLI-43: Add -g/--global flag to sonar integrate claude#54
kirill-knize-sonarsource merged 3 commits intomasterfrom
feature/CLI-43-global-integrate

Conversation

@kirill-knize-sonarsource
Copy link
Member

When --global (-g) is passed, hooks and settings.json are installed to ~/.claude/ instead of the project-level .claude/ directory.

Copy link
Contributor

@damien-urruty-sonarsource damien-urruty-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some suggestions for improvement

When --global (-g) is passed, hooks and settings.json are installed
to ~/.claude/ instead of the project-level .claude/ directory.
Global hook commands use absolute paths so they work regardless of
which project directory Claude Code is running from.
@kirill-knize-sonarsource kirill-knize-sonarsource force-pushed the feature/CLI-43-global-integrate branch from 9dcd1ba to 692da34 Compare February 27, 2026 15:49
@sonarqubecloud
Copy link

SonarQube reviewer guide

Review in SonarQube

Summary: Add global installation support for SonarQube integration hooks, allowing users to install configuration and hooks to ~/.claude for use across all projects via a new --global flag.

Review Focus:

  • The hooks installation logic now conditionally uses absolute vs. relative paths based on a globalDir parameter—verify path handling is correct for both cases
  • The runHealthCheckAndRepair function signature changed to accept an optional hooksGlobal parameter; ensure all callers pass the correct value
  • The regex pattern change in validate-commands.js for multi-line option parsing is more complex—confirm it correctly handles edge cases

Start review at: src/bootstrap/hooks.ts. This is the core logic implementing global vs. project-scoped installation, with critical changes to path resolution that directly impact whether hooks work correctly in both modes.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues
0 Dependency risks

Measures
0 Security Hotspots
95.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@kirill-knize-sonarsource kirill-knize-sonarsource merged commit dd11688 into master Feb 27, 2026
9 checks passed
@kirill-knize-sonarsource kirill-knize-sonarsource deleted the feature/CLI-43-global-integrate branch February 27, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants