Skip to content

Commit 824826b

Browse files
nkolev92Copilot
andcommitted
Add test-first bugfix guidance
Co-authored-by: Copilot <[email protected]>
1 parent cf044d8 commit 824826b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717

1818
- All files in the repository are nullable by default (project-level nullable enable). No need to add `#nullable enable` directives to individual files.
1919

20+
## Bug Fixing Guidance
21+
22+
- Prefer a test-first workflow for bug fixes. Write a focused repro test that fails for the correct reason before changing the implementation.
23+
- Make the failure details explicit in the assertion or expected message so the test proves the actual bug, not just that something failed.
24+
- Treat TDD as the default for bug fixing: reproduce the issue, fix it, and keep the regression test in place.
25+
- When a bug may flow through shared infrastructure or multiple entry points, add parity coverage across the affected surfaces instead of validating only one caller.
26+
- For restore bugs involving settings, source resolution, or command-line properties, preserve parity across `nuget.exe`, `dotnet restore`, and `msbuild /t:restore`.
27+
- When testing explicit restore source inputs (`-Source`, `--source`, `/p:RestoreSources`), cover both direct paths/URLs and named package sources defined in `NuGet.Config`. A source value may be a configured source name, not just a filesystem path.
28+
- Prefer a layered test strategy for restore and pack changes: add fast unit coverage around the shared helper or factory logic first, then add at least one integration/functional regression for the relevant client entry points.
29+
2030
## Nullable Migration Rules
2131

2232
- **Shipped.txt format must be precise** — e.g. `string![]!` not `string![]`, `byte[]?` not `byte?[]`. Always match the format of existing base class entries in the same file.

0 commit comments

Comments
 (0)