Skip to content

Conversation

@GeorgeLeithead
Copy link
Contributor

Description of Change

This PR adds natural language instructions for CoPilot to assist contributors with its automated code reviews and code completion suggestions and guidance.

More the the docs:

About coding guidelines

You can customize Copilot code review with custom coding guidelines written in natural language. For more information on Copilot code review, see Using GitHub Copilot code review.
With coding guidelines, Copilot can give feedback based on your organization's specific coding style and best practices.
Because Copilot code review is powered by a large language model, it can help with enforcing coding guidelines that are not covered by your linter or static analysis tool.
Coding guidelines are configured at the repository level. You can create and enable up to 6 coding guidelines per repository.

Linked Issues

PR Checklist

  • Rebased on top of main at time of PR

Copy link
Member

@pictos pictos left a comment

Choose a reason for hiding this comment

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

It looks good, just need to fix some invalid chars and I've a couple of suggestions. I'll mark as Request Changes because of the invalid chars.

Resolved some suggestions.
@GeorgeLeithead
Copy link
Contributor Author

It looks good, just need to fix some invalid chars and I've a couple of suggestions. I'll mark as Request Changes because of the invalid chars.

Thanks Pedro. I think I have eliminated all of the invalid characters and also implemented all of the changes you suggested.

@GeorgeLeithead
Copy link
Contributor Author

@pictos @TheCodeTraveler @bijington @VladislavAntonyuk I had added a new prompt, specifically for MCT, that details some of the common code styles and implementation templates that we use.

Please give them a try out.

I personally appreciate the code reviews provided, but as this is NOT code that the end-user will be provided, please feel free to update this fork/branch as appropriate. The more the better.

@TheCodeTraveler TheCodeTraveler requested a review from Copilot March 12, 2025 23:04
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 adds several markdown documents that provide natural language guidelines on asynchronous programming, unit testing, memory leak prevention, MAUI controls, and general GitHub Copilot usage for the .NET MAUI Community Toolkit.

  • Introduces coding guideline documents for asynchronous operations, unit testing with xUnit, and MAUI-specific practices.
  • Provides detailed best practices for memory management, UI controls design, and overall code quality for MAUI projects.
  • Adds GitHub Copilot instructions to help guide contributors on using Copilot effectively.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/prompts/dotnet/async.prompt.md New async programming best practices guideline document
.github/prompts/dotnet/testing.xunit.prompt.md New unit testing best practices guideline document using xUnit
.github/prompts/dotnet/maui/maui-memory-leaks.prompt.md New guidelines for handling memory leaks in .NET MAUI applications
.github/prompts/dotnet/maui/maui-controls.prompt.md New guidelines for page lifecycle and controls in .NET MAUI
.github/copilot-instructions.md New documentation outlining GitHub Copilot usage and best practices
.github/prompts/prompts.prompt.md New list of prompt instructions linking all the guideline documents

Copy link
Member

@pictos pictos left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for it @GeorgeLeithead

@TheCodeTraveler TheCodeTraveler merged commit c0a20b0 into CommunityToolkit:main Mar 13, 2025
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
@GeorgeLeithead GeorgeLeithead deleted the CoPilotInstructions branch March 17, 2025 14:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants