Add copilot-instructions.md to get GitHub Copilot up to speed with the toolkit's coding standards and preferences #2543
GeorgeLeithead
started this conversation in
New Feature Discussions
Replies: 3 comments 4 replies
-
An example of the file can be found in this fork: https://github.com/GeorgeLeithead/CommunityToolkitMaui/tree/CoPilotInstructions |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is a great idea. I would love to see this in the toolkit. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Super cool! I didn’t know this existed! Reading the docs, it looks like only someone with maintainer-access to the repo can add it as it requires access to the repo’s settings. I’ll take a look today to see about adding it 🙌 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With the recent release of GitHub Copilot Free, an increasing number of community members are leveraging this tool to assist with their contributions to the .NET MAUI Community Toolkit. To ensure that contributions align with the toolkit's coding standards and preferences, we propose the addition of a copilot-instructions.md file to the repository.
Objective
The primary objective of this proposal is to guide GitHub Copilot in adhering to the .NET MAUI Community Toolkit's coding standards and preferences. By providing clear instructions, we can enhance the quality and consistency of contributions made by the community.
Benefits
Efficiency: Contributors can quickly get up to speed with the toolkit's guidelines, reducing the time spent on code reviews and revisions.
Implementation
Conclusion
Adding a copilot-instructions.md file to the .NET MAUI Community Toolkit repository will significantly benefit the community by providing clear guidance on coding standards and preferences. This will not only improve the quality and consistency of contributions but also streamline the development process by leveraging GitHub Copilot's capabilities.
An example could be as follows (which I have collated by taking the CONTRIBUTING.md and expanding upon).
!
null forgiving operator to avoid the unintended introduction of bugs.Type checking
is
when checking for types instead of casting.e.g.
File Scoped Namespaces
e.g.
Braces
Please use
{ }
afterif
,for
,foreach
,do
,while
, etc.e.g.
NotImplementedException
NotImplementedException
. According to the Microsoft Docs, we should only "throw aNotImplementedException
exception in properties or methods in your own types when that member is still in development and will only later be implemented in production code. In other words, a NotImplementedException exception should be synonymous with 'still in development.'"In other words,
NotImplementedException
implies that a feature is still in development, indicating that the Pull Request is incomplete.Bug Fixes
If you're looking for something to fix, please browse open issues.
Follow the style used by the .NET Foundation, with two primary exceptions:
private
keyword as it is the default accessibility level in C#._
ors_
as a prefix for internal or private field namescamelCaseFieldName
for naming internal or private fields in both instance and static implementationsRead and follow our Pull Request template
Submitting Contributions
Additional Resources
• (GitHub Copilot Documentation)[https://docs.github.com/en/copilot]
• (.NET MAUI Documentation)[https://learn.microsoft.com/en-us/dotnet/maui/]
By following these guidelines, you can effectively use GitHub Copilot to contribute to the .NET MAUI Community Toolkit. Thank you for your contributions!
Beta Was this translation helpful? Give feedback.
All reactions