Skip to content

Conversation

marcpopMSFT
Copy link
Member

Updated guidelines for committing changes and testing. dotnet format doesn't allow for formatting a single file. If copilot tries to format, it'll try the file, then the solution, and then the project resulting in lots of formatting. This will enable us to fix formatting but not mess up the diffs.

Updated guidelines for committing changes and testing.
dotnet format doesn't allow for formatting a single file. If copilot tries to format, it'll try the file, then the solution, and then the project resulting in lots of formatting. This will enable us to fix formatting but not mess up the diffs.
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 23:22
Copy link
Contributor

github-actions bot commented Oct 2, 2025

This PR is targeting main, which is now for .NET 11-facing work. If you intended to target .NET 10, either retarget this PR to release/10.0.1xx or make sure you backport the change to release/10.0.1xx after merging. See #50394 for more details.

Copy link
Contributor

@Copilot 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 improve the code formatting workflow. The change addresses an issue where dotnet format can cause excessive formatting changes across multiple files when trying to format a single file.

  • Added guidance to commit changes before formatting to separate logical changes from formatting changes
  • Added instruction to update .git-blame-ignore-revs file to prevent formatting commits from affecting git blame history

- When generating code, run `dotnet format` to ensure uniform formatting.
- Prefer using file-based namespaces for new code.
- Do not allow unused `using` directives to be committed.
- commit your changes, and then format them.
Copy link
Preview

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

Capitalized the first word of the sentence for consistency with other guidelines.

Suggested change
- commit your changes, and then format them.
- Commit your changes, and then format them.

Copilot uses AI. Check for mistakes.

- Prefer using file-based namespaces for new code.
- Do not allow unused `using` directives to be committed.
- commit your changes, and then format them.
- add the format commit SHA to the .git-blame-ignore-revs file so that the commit doesn't dirty git blame in the future
Copy link
Preview

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

Capitalized the first word of the sentence for consistency with other guidelines.

Suggested change
- add the format commit SHA to the .git-blame-ignore-revs file so that the commit doesn't dirty git blame in the future
- Add the format commit SHA to the .git-blame-ignore-revs file so that the commit doesn't dirty git blame in the future

Copilot uses AI. Check for mistakes.

@baronfel
Copy link
Member

baronfel commented Oct 3, 2025

It'll be interesting to see if it will create the git-blame-ignore-refs file in the first place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants