-
Notifications
You must be signed in to change notification settings - Fork 1k
copilot instructions #13046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copilot instructions #13046
Conversation
I have no issues with this, letting @KlausLoeffelmann add his additional comments. |
5276d7e
to
c4a8131
Compare
@Tanya-Solyanik looks like @KlausLoeffelmann is happy with this. Are you ready to merge? |
c4a8131
to
fadd0ba
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13046 +/- ##
====================================================
+ Coverage 61.36344% 95.67947% +34.31603%
====================================================
Files 1547 529 -1018
Lines 158482 62122 -96360
Branches 14752 1309 -13443
====================================================
- Hits 97250 59438 -37812
+ Misses 60529 2381 -58148
+ Partials 703 303 -400
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
||
## General | ||
|
||
* In the main branch, write code that runs on .NET 10.0, but keep in mind that we have a couple of.NET Framework and multi-targeted code files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, what you want to achieve with that and on what level. FWIW, if it's targeted to Review instructions, I don't think that those are getting picked up from here.
As for code generation, I think the instruction is not precise enough. You could hint at a certain C# versions, or suggest to use something concrete over something concrete. But I do not think that this comment will change anything in terms of code generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied from the "lightning talk" presentation, yes this is targeted to the review instructions. This file is consumed by the GH per docs. I want GH Copilot to not suggest getting rid of Range
|
||
* In the main branch, write code that runs on .NET 10.0, but keep in mind that we have a couple of.NET Framework and multi-targeted code files. | ||
* Make only high-confidence suggestions when reviewing code changes. | ||
* Do not edit files in `eng/common/`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, if it makes sense to write instructions to prevent vague "in case of" things.
I think makes only sense to prevent an LLM to modify something, when a companion instruction would directly open the possibility that that could happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is targeted for GH code reviews, this is copied from other team's instructions and is a reminder that we don't own files in eng/common
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not connived about the usefulness of many of those.
But the 'Do not modify the Designer code' would be a showstopper for me, so, I would like to veto that, if I may?!
.github/copilot-instructions.md
Outdated
* In the main branch, write code that runs on .NET 10.0, but keep in mind that we have a couple of.NET Framework and multi-targeted code files. | ||
* Make only high-confidence suggestions when reviewing code changes. | ||
* Do not edit files in `eng/common/`. | ||
* Do not edit designer-generated files, i.e. *.Designer.cs and *.Designer.vb files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is something, which I would even block. Because I often ask Copilot to design a Form for me. How should it do that, when it's not allow to edit the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you open that form in the designer your edits would be lost, and designer generates code that does not follow our naming standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just for GH Code Review suggestions, right? In that case, I don't see why this would block your scenario @KlausLoeffelmann. Locally on your machine you can certainly ask Copilot edits to help you design a form (I often do as well) but then if making a PR, it would just ignore the code in InitializeComponent()
which we would ignore when reviewing as a human anyway since we know it's generated, will be regenerated the next time the form is loaded, and doesn't meet our coding guidance.
.github/copilot-instructions.md
Outdated
## Nullable Reference Types | ||
|
||
* Declare variables non-nullable, and check for `null` at entry points. | ||
* Trust the C# null annotations and don't add null checks when the type system says a value cannot be null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give me a sample, what you mean by this?
And also, for public APIs, wouldn't that be wrong? I mean we always have to check for null and then throw null reference exceptions. So, I am not sure, what you had in mind with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about public arguments, my intention was to fix things like this -
get => ImageIndexer?.Key; |
@@ -102,7 +102,7 @@ internal bool SingleVerticalBorderAdded | |||
### Namespace Usings | |||
|
|||
1. Namespace `using`s should be specified at the top of the file, before `namespace` declarations, and should be sorted alphabetically, with the exception of `System.*` namespaces, which are to be placed on top of all others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather add a file header here as a sample, and then simply state, very briefly how to apply that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not my intention to edit this file.
Developing these instructions will be an iterative process and this is only the first iteration. There is probably more we can add later. https://github.blog/changelog/2025-01-21-custom-repository-instructions-are-now-available-for-copilot-on-github-com-public-preview/
fadd0ba
to
bdcf4eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try this now.
I have a few additional ideas, but they can wait until you're back!
FWIW, I've been using the following prompt:
|
Developing these instructions will be an iterative process and this is only the first iteration.
There is more we can add later.
https://github.blog/changelog/2025-01-21-custom-repository-instructions-are-now-available-for-copilot-on-github-com-public-preview/
Microsoft Reviewers: Open in CodeFlow