Repository navigation
Update instructions for .expected files - #22856
Conversation
This phrasing bothered me when I saw it. "ignore these files" suggests Copilot should neither write nor *read* the files, but reading them is a perfectly normal, useful thing to do. I don't know a reasonable way to test this proposed change.
There was a problem hiding this comment.
🟢 Approval recommended
The wording resolves the ambiguity without weakening the restriction on direct edits.
No open issues 🎉
What changed in this PR
Clarifies Copilot guidance for generated .expected files, allowing reading while preserving the restriction on direct edits.
Changes:
- Replaces “Ignore these files” with an explicit instruction not to edit them directly.
| File | Description |
|---|---|
.github/instructions/expected-files.instructions.md |
Clarifies guidance for generated test expectations. |
Review effort: Max
owen-mc
left a comment
There was a problem hiding this comment.
Another idea: tell it that for inline expectations tests, .expected files shouldn't be commited with a non-empty testFailures section.
Good idea. How about:
|
|
That sounds good. I think there are some cases where it's very difficult to avoid a non-empty testFailures section, e.g. in files where we can't easily put a comment (yml? json?), or when the alerts change when you add a comment, so it's good that you didn't make it a hard requirement. |
This phrasing bothered me when I saw it. "ignore these files" suggests Copilot should neither write nor read
.expectedfiles, whereas I think we only mean to ban writing them ("manually"). Reading them should be a perfectly normal thing to do.I haven't witnessed the existing wording drive Copilot astray, and I don't know of a reasonable way to test the change I propose.