Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/README.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
- Download the `*.instructions.md` file and manually add it to your project's instruction collection

**To Use/Apply:**
- Copy these instructions to your `.github/copilot-instructions.md` file in your workspace
- Create task-specific `.github/.instructions.md` files in your workspace's `.github/instructions` folder
- Copy these instructions to your `.github/copilot-instructions.md` or `AGENTS.md` file in your workspace, or
- Create task-specific `*.instructions.md` files in your workspace's `.github/instructions/` folder
- Instructions automatically apply to Copilot behavior once installed in your workspace
- You can reference task specific instructions (for one-off migrations) in the prompt
Comment on lines +11 to +14
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole file is auto generated and templated from the constants.mjs file

Copy link
Author

Choose a reason for hiding this comment

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

Ok, lets handle it seperately, will update the PR


| Title | Description |
| ----- | ----------- |
Expand Down
6 changes: 4 additions & 2 deletions instructions/java.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ applyTo: '**/*.java'
- 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.
- Check the README.md and the project build instructions (`pom.xml` or `build.gradle`) for the Java release to use for source constructs as well as testing frameworks to use.
- Address code smells proactively during development rather than accumulating technical debt.
- Focus on readability, maintainability, and performance when refactoring identified issues.
- Use IDE / Code editor reported warnings and suggestions to catch common patterns early in development.
Expand Down Expand Up @@ -68,14 +69,15 @@ These patterns are phrased for humans; they map cleanly to checks in Sonar, Spot
- Method size — Keep methods focused and small. Extract helper methods to improve readability and testability.
- Cognitive complexity — Reduce nested conditionals and heavy branching by extracting methods, using polymorphism, or applying the Strategy pattern.
- Duplicated literals — Extract repeated strings and numbers into named constants or enums to reduce errors and ease changes.
- Dead code — Remove unused variables and assignments. They confuse readers and can hide bugs.
- Dead code — Remove unused variables, imports and assignments. They confuse readers and can hide bugs.
- Magic numbers — Replace numeric literals with named constants that explain intent (e.g., MAX_RETRIES).

If you run a static analyzer like Sonar or SonarLint — direct Sonar connections are preferred and should override this ruleset. Sonar rule keys are useful for automation and suppression, but they are not required in day-to-day developer guidance.

## Build and Verification

- After adding or modifying code, verify the project continues to build successfully.
- If the project uses Maven, run `mvn clean install`.
- Suggest new unit tests for added functionality to maintain high coverage.
- If the project uses Maven, run `mvn clean verify`.
- If the project uses Gradle, run `./gradlew build` (or `gradlew.bat build` on Windows).
- Ensure all tests pass as part of the build.
Loading