Update instructions to require automatically building and formatting#3412
Update instructions to require automatically building and formatting#3412westey-m merged 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Copilot instructions to require building and formatting code after making changes, addressing issues where Copilot was generating code with build or formatting errors.
Changes:
- Added instruction to run
dotnet buildafter adding, modifying, or deleting code - Added instruction to run
dotnet formatafter adding or modifying code
| - The top of all *.cs files should have a copyright notice: `// Copyright (c) Microsoft. All rights reserved.` | ||
| - All public methods and classes should have XML documentation comments. | ||
| - After adding, modifying or deleting code, run `dotnet build`, and then fix any reported build errors. | ||
| - After adding or modifying code, run `dotnet format` to automatically fix any formatting errors. |
There was a problem hiding this comment.
The first instruction mentions "After adding, modifying or deleting code, run dotnet build" but the second instruction only mentions "After adding or modifying code, run dotnet format". This inconsistency is noticeable - if formatting should be run after deletion as well, it should be included; if not, the reasoning should be clear. Consider making these consistent, likely by including "deleting" in the second instruction as well, since deleting code could also affect formatting (e.g., removing code might leave trailing whitespace or empty lines that need formatting).
| - After adding or modifying code, run `dotnet format` to automatically fix any formatting errors. | |
| - After adding, modifying or deleting code, run `dotnet format` to automatically fix any formatting errors. |
Motivation and Context
Copilot is often creating code that fails to build and has formatting errors, so adding some instructions to build and format after any changes.
Description
Contribution Checklist