|
| 1 | +# LibPalaso Copilot Instructions |
| 2 | + |
| 3 | +You are an expert C# developer assisting with the `sillsdev/libpalaso` repository. Follow these critical guidelines for all code generation. |
| 4 | + |
| 5 | +## 1. Code Standards & Quality |
| 6 | +- **Modern C#:** Prefer modern C# syntax (e.g., pattern matching, switch expressions, file-scoped namespaces) unless maintaining legacy consistency. |
| 7 | +- **Null Safety:** Strictly adhere to Nullable Reference Types. Explicitly handle potential nulls; do not suppress warnings with `!` unless absolutely necessary. |
| 8 | +- **Cross-Platform:** Remember that LibPalaso runs on Windows and Linux (Mono/.NET). Avoid Windows-specific APIs (like `Registry` or hardcoded `\` paths) unless wrapped in OS checks. |
| 9 | + |
| 10 | +## 2. Testing |
| 11 | +- **Framework:** Use **NUnit** for all unit tests. |
| 12 | +- **Mocking:** Use **Moq** for mocking interfaces when necessary. |
| 13 | +- **Structure:** When writing tests, follow the `Given_When_Then` or `State_Action_Result` naming convention for clarity. |
| 14 | + |
| 15 | +## 3. Documentation & Process (Critical) |
| 16 | +- **Update the Changelog:** If the suggested code changes functionality, fixes a bug, or adds a feature, you **must** generate an update for `CHANGELOG.md`. |
| 17 | + - Look for the `## [Unreleased]` section at the top of the changelog. |
| 18 | + - Insert a bullet point under the appropriate subsection based on the type of change: |
| 19 | + - `### Added` - for new features, methods, classes, or capabilities |
| 20 | + - `### Fixed` - for bug fixes and corrections |
| 21 | + - `### Changed` - for changes in existing functionality, including BREAKING CHANGES |
| 22 | + - `### Deprecated` - for soon-to-be removed features (mark with `[Obsolete]` attribute) |
| 23 | + - `### Removed` - for features that have been completely removed |
| 24 | + - `### Security` - for security-related fixes or improvements |
| 25 | + - If the subsections do not exist under `[Unreleased]`, create them as needed. |
| 26 | + - Format: `- **[Scope]** Description of the change.` (where Scope is the affected library/namespace) |
| 27 | + - For breaking changes, prefix with `BREAKING CHANGE:` in the description. |
0 commit comments