Skip to content

Conversation

@westey-m
Copy link
Contributor

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

  • Update instructions to require automatically building and formatting

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings January 23, 2026 14:19
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Jan 23, 2026
@westey-m westey-m enabled auto-merge January 23, 2026 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 build after adding, modifying, or deleting code
  • Added instruction to run dotnet format after 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.
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
- 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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants