Skip to content

Commit d447741

Browse files
authored
Merge pull request #226 from Afterlife-Guide/feature/issue-225-sonar-copilot
Add copilot instructions
2 parents 0576540 + b92282f commit d447741

3 files changed

Lines changed: 94 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Copilot Setup Steps"
2+
3+
on: workflow_dispatch
4+
5+
env:
6+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7+
8+
jobs:
9+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
10+
copilot-setup-steps:
11+
runs-on: ubuntu-latest
12+
13+
# Set the permissions to the lowest permissions possible needed for your steps.
14+
# Copilot will be given its own token for its operations.
15+
permissions:
16+
contents: read
17+
18+
# You can define any steps you want, and they will run before the agent starts.
19+
# If you do not check out your code, Copilot will do this for you.
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
23+
- name: Setup .NET Core
24+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
25+
with:
26+
dotnet-version: |
27+
8.0.x
28+
9.0.x

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Migrated from `thomaseizinger/keep-a-changelog-new-release` to `baynezy/ChangeLogger.Action` (#210)
1313
- Added GH_TOKEN environment variable to all GitHub Action workflows for consistent token access (#215)
14+
- Set up copilot environment (#225)
1415

1516
## [1.1.1.16] - 2025-06-06
1617

0 commit comments

Comments
 (0)