docs(java): improve SonarQube setup instructions readability

- Break long bullet points into structured sub-bullets for clarity
 - Organize SonarQube troubleshooting steps into numbered sequence
 - Separate fallback tools configuration from main Sonar workflow

Fixes #296
Co-authored-by: GitHub Copilot <github.copilot@github.com>

Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
This commit is contained in:
Ashley Childress 2025-10-19 22:37:18 -04:00
parent bf51e66777
commit a660941b54
No known key found for this signature in database
GPG Key ID: 421CEE00065906BD

View File

@ -8,8 +8,23 @@ applyTo: '**/*.java'
## General Instructions ## General Instructions
- First, prompt the user if they want to integrate static analysis tools (SonarQube, PMD, Checkstyle) into their project setup. - First, prompt the user if they want to integrate static analysis tools (SonarQube, PMD, Checkstyle) into their project setup.
- If yes, document a recommended static-analysis setup. Prefer SonarQube/SonarCloud (SonarLint in IDE + `sonar-scanner` in CI). Include: creating a Sonar project key, storing the scanner token in CI secrets, and a sample CI job that runs the scanner. If the team declines Sonar, note this in project README and continue. - If yes, document a recommended static-analysis setup.
- If Sonar is bound to the project, use Sonar as the primary source of actionable issues and reference Sonar rule keys in remediation guidance. If Sonar is unavailable, perform up to 3 troubleshooting checks (1. verify project binding and token, 2. ensure SonarScanner runs in CI, 3. confirm SonarLint is installed and configured). If still failing after 3 attempts, enable SpotBugs/PMD/Checkstyle as CI fallbacks and open a short tracker issue documenting the blocker and next steps. - Prefer SonarQube/SonarCloud (SonarLint in IDE + `sonar-scanner` in CI).
- Create a Sonar project key.
- Store the scanner token in CI secrets.
- Provide a sample CI job that runs the scanner.
- If the team declines Sonar, note this in the project README and continue.
- If Sonar is bound to the project:
- Use Sonar as the primary source of actionable issues.
- Reference Sonar rule keys in remediation guidance.
- If Sonar is unavailable:
- Perform up to 3 troubleshooting checks:
1. Verify project binding and token.
2. Ensure SonarScanner runs in CI.
3. Confirm SonarLint is installed and configured.
- If still failing after 3 attempts:
- Enable SpotBugs, PMD, or Checkstyle as CI fallbacks.
- Open a short tracker issue documenting the blocker and next steps.
- If the user declines static analysis tools or wants to proceed without them, continue with implementing the Best practices, bug patterns and code smell prevention guidelines outlined below. - If the user declines static analysis tools or wants to proceed without them, continue with implementing the Best practices, bug patterns and code smell prevention guidelines outlined below.
- Address code smells proactively during development rather than accumulating technical debt. - Address code smells proactively during development rather than accumulating technical debt.
- Focus on readability, maintainability, and performance when refactoring identified issues. - Focus on readability, maintainability, and performance when refactoring identified issues.