|
| 1 | +# GitHub Copilot Instructions |
| 2 | + |
| 3 | +This document contains guidelines that GitHub Copilot should follow when assisting with this repository. |
| 4 | + |
| 5 | +## General |
| 6 | + |
| 7 | +* Make only high confidence suggestions when reviewing code changes. |
| 8 | +* Infer the naming conventions and coding standards from the existing codebase. |
| 9 | +* Prefer UK English spelling for all text, including comments and documentation. |
| 10 | + |
| 11 | +## Formatting |
| 12 | + |
| 13 | +* Apply code-formatting style defined in `.editorconfig`. |
| 14 | +* Prefer file-scoped namespace declarations and single-line using directives. |
| 15 | +* Ensure that the final return statement of a method is on its own line. |
| 16 | +* Use pattern matching and switch expressions wherever possible. |
| 17 | +* Use `nameof` instead of string literals when referring to member names. |
| 18 | + |
| 19 | +### Nullable Reference Types |
| 20 | + |
| 21 | +* Declare variables non-nullable, and check for `null` at entry points. |
| 22 | +* Always use `is null` or `is not null` instead of `== null` or `!= null`. |
| 23 | +* Trust the C# null annotations and don't add null checks when the type system says a value cannot be null. |
| 24 | + |
| 25 | +### Testing |
| 26 | + |
| 27 | +* Write unit tests for all new features and bug fixes. |
| 28 | +* Add `arrange`, `act`, and `assert` comments to unit tests to clarify the structure. |
| 29 | +* We use the following testing frameworks: |
| 30 | + - xUnit for unit tests |
| 31 | + - NSubstitute for mocking dependencies |
| 32 | + - AwesomeAssertions for assertions |
| 33 | + - Verify for snapshot testing |
| 34 | + - FsCheck for Property-based testing |
| 35 | +* Copy existing style in nearby files for test method names and capitalisation. |
| 36 | + |
| 37 | +## Running Tests |
| 38 | + |
| 39 | +1. Install the latest version of Cake `dotnet tool install Cake.Tool`. |
| 40 | +2. Build using `dotnet cake --target=Build`. |
| 41 | +3. If that produces errors, fix those errors and build again. Repeat until the build is successful. |
| 42 | +4. Run tests using the Cake build script with `dotnet cake --testFilter="Category!=LocalTest"`. |
| 43 | + |
| 44 | +## SonarQube |
| 45 | + |
| 46 | +* The project name in SonarQube is `Afterlife-Guide_SemVer.Action`. |
| 47 | + |
| 48 | +## Changelog Updates |
| 49 | + |
| 50 | +For all Pull Requests created: |
| 51 | + |
| 52 | +1. **An entry must be added to CHANGELOG.md** under the `[Unreleased]` section. |
| 53 | +2. Entries should follow the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. |
| 54 | +3. Group changes under the appropriate headings: |
| 55 | + - `Added` for new features |
| 56 | + - `Changed` for changes in existing functionality |
| 57 | + - `Deprecated` for soon-to-be removed features |
| 58 | + - `Removed` for now removed features |
| 59 | + - `Fixed` for any bug fixes |
| 60 | + - `Security` in case of vulnerabilities |
| 61 | +4. Be concise but descriptive in the changelog entries. |
| 62 | +5. Make sure the entry clearly communicates the purpose and impact of the change. |
| 63 | +6. Add a reference to the issue number if applicable. |
| 64 | + |
| 65 | +This changelog update is required for all PRs to maintain a comprehensive history of changes to the project. |
0 commit comments