alaahong opened a new pull request, #958: URL: https://github.com/apache/fesod/pull/958
## Purpose of the pull request Add GitHub Copilot custom instructions to improve automated code review quality and reduce repetitive review feedback on PRs. This follows the official [GitHub Copilot repository instructions](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions) feature. ## What's changed? ### Background Copilot code review on recent PRs (#954 etc.) raised valid points (e.g., `FileWriter` using platform-default charset, deprecated `java.util.Date` constructors) that could have been caught earlier with proper repository context. These instructions encode project-specific conventions so Copilot can provide more accurate and actionable review feedback. ### Files added 1. **`.github/copilot-instructions.md`** — Repository-wide instructions (applies to all Copilot interactions): - Project overview: Apache Fesod (Incubating), Java 8+, POI-based streaming Excel/CSV library - Build & test commands: `./mvnw` wrapper, module-specific test commands, tag-based filtering - Code style: Palantir Java Format (Spotless), ASF license header, Lombok config - Module structure: fesod-common → fesod-shaded → fesod-bom → fesod-sheet dependency graph - Testing conventions: JUnit 5 `@Tag` system (unit, round-trip, read, write, format, fuzz) - CI checks: multi-JDK matrix (8/11/17/21/25), Spotless, license, CodeQL 2. **`.github/instructions/code-review.instructions.md`** — Path-specific Java review instructions (`applyTo: "**/*.java"`): - **8 priority check dimensions** derived from real bug fixes and Copilot review feedback - **Common pitfalls table** with 5 patterns extracted from actual fixes: - `toInstant()` on `java.sql.Date`/`Time` → `UnsupportedOperationException` - `value == -1` validation missing other negative values - Premature `ThreadLocal` cleanup in `finally` blocks - Missing `toMutableListIfNecessary()` defensive copy in builders - `FileWriter` platform-default charset in tests - Each rule references the specific code path it applies to <img width="416" height="336" alt="image" src="https://github.com/user-attachments/assets/313c12ca-f888-4b0c-8030-51bf9064d8b7" /> ### Design decisions - **Two files instead of one**: Repository-wide instructions provide general context; path-specific instructions focus Copilot review on Java-specific concerns. This matches GitHub's recommended structure. - **Pitfalls table format**: Compact reference table is easier for Copilot to pattern-match against code than prose paragraphs. - **No task-specific instructions**: Per GitHub's guidance, instructions are general project conventions, not tied to specific issues or features. ## Checklist - [x] I have read the [Contributor Guide](https://fesod.apache.org/community/contribution/). - [x] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. (No unit tests required — this PR adds documentation/configuration files only. Spotless pre-push hook passed: all 482 Java files clean.) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
