CLI-664 Agent integrations for multi-file change-set analysis#471
CLI-664 Agent integrations for multi-file change-set analysis#471nquinquenel wants to merge 6 commits into
Conversation
✅ Deploy Preview for sonarqube-cli canceled.
|
fd9444f to
88bd2a0
Compare
Agentic Analysis: Early ResultsAgentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action. 2 issue(s) found across 1 file(s):
Analyzed by SonarQube Agentic Analysis in 6.6 s |
|
gitar auto-apply:on |
…dd legacy cleanup comment Co-authored-by: Nicolas QUINQUENEL <14952624+nquinquenel@users.noreply.github.com>
|
gitar auto-apply:off |
| const entries: ResolvedSqaaFileEntry[] = []; | ||
|
|
||
| for (const path of rawArgs) { | ||
| const absolutePath = resolve(cwd, normalizePath(path)); |
There was a problem hiding this comment.
💡 Edge Case: normalizePath clobbers literal backslashes in POSIX file paths
normalizePath (src/lib/fs-utils.ts:24) unconditionally replaces every backslash with a forward slash, and it is now applied to user-supplied --file arguments at src/cli/commands/analyze/sqaa-file-arg.ts:46 before resolve. On POSIX systems a backslash is a legal filename character, so a real file like weird ame.ts in the working directory would be rewritten to weird/name.ts and then fail the statSync existence check (File not found) or resolve to the wrong path. This is intentional and desirable on Windows (where \ is the separator), but unconditional replacement misbehaves on Linux/macOS.
Impact is low because filenames containing backslashes are rare, so this is minor. If cross-platform separator handling is the goal, consider only normalizing backslashes on Windows (e.g. guard with process.platform === 'win32' or use path.win32/path.sep-aware logic) so legitimate POSIX filenames are preserved.
Only collapse backslashes to forward slashes on Windows, preserving literal backslashes in POSIX filenames.:
export const normalizePath = (p: string): string =>
process.platform === 'win32' ? p.replaceAll('\', '/') : p;
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 7 resolved / 8 findingsImplements multi-file change-set analysis for agent integrations and resolves several analysis flow bugs, including force-flag propagation and duplicate path handling. Verify the 💡 Edge Case: normalizePath clobbers literal backslashes in POSIX file paths📄 src/cli/commands/analyze/sqaa-file-arg.ts:46
Impact is low because filenames containing backslashes are rare, so this is minor. If cross-platform separator handling is the goal, consider only normalizing backslashes on Windows (e.g. guard with Only collapse backslashes to forward slashes on Windows, preserving literal backslashes in POSIX filenames.✅ 7 resolved✅ Bug: --force not forwarded from bare
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|




Claude Code:

Cursor:

Summary by Gitar
ClaudeStophook to perform aggregated git change-set analysis at the end of agent turns.Stophook in Claude integration logic and updatedCLAUDE.mddocumentation.sonar analyze agentic --project <key>instead of single-file loops.--forceflag for large change-sets (50+ files) in the SQAA protocol instructions.sonar hook claude-stop.Stophook registration.This will update automatically on new commits.