Skip to content

Commit 6d195a1

Browse files
Apply suggestions from code review
Adding some great suggested changes from guardrex. Co-authored-by: Luke Latham <[email protected]>
1 parent da48207 commit 6d195a1

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/copilot-instructions.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ This document contains repository-specific instructions for GitHub Copilot when
1515
- Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
1616
- **Repository Exceptions**:
1717
- Number ordered lists as "1." for every item (don't use sequential numbers)
18-
- Use `code style` specifically for file names, folders, custom types, and code that should never be localized
18+
- Use backticks, also called backquotes or graves, around content specifically for file names (`file.txt`), folders (`folder`), file paths (`folder/file.txt`), custom types (`myVariable`, `MyClass`), raw URLs in the text (`https://www.contoso.com`), URL segments (`/product/id/199`), file extensions (`.razor`), NuGet packages (`Microsoft.AspNetCore.SignalR.Client`), and code that should never be localized
19+
- For Blazor's Razor components mentioned in article text, use backticks around the name of the component (example: `Counter` component)
1920
- For any new .md file added to the repository or any updated .md file ensure the standaerd frontmatter (meta data) specified by the Style Guide is included.
2021
- For any new .md file added to the repository or any updated .md file ensure the following frontmatter (meta data) is included.
2122
- Metadata `ai-usage: ai-assisted` if any AI assistance was used
22-
- Metadata `ms.date: <today's date>` with a format of DD-MM-YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters have changed in the file.
23+
- The correct order of metadata lines is to place the title (`title`) first and the rest of the metadata lines in alphabetical order. Example: `title`, `author`, `description`, `monikerRange`, `ms.author`, `ms.custom`, `ms.date`, `uid`, `zone_pivot_groups`
24+
- Metadata `ms.date: <today's date>` with a format of MM-DD-YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters are changed in the file.
2325

2426
## Version Targeting
2527

@@ -83,14 +85,33 @@ This document contains repository-specific instructions for GitHub Copilot when
8385
```
8486
:::code language="csharp" source="~/path/to/file.cs" range="5-10" highlight="2-3":::
8587
```
86-
- Use modern C# coding patterns in all examples
88+
- Use the latest, non-preview C# coding patterns in non-preview code examples
89+
- Use the latest preview C# coding patterns in preview code examples
90+
91+
The following table indicates the code language to use for markdown code blocks or the `language` attribute of a code snippet and the amount of indentation to use.
92+
93+
Content of the snippet | Code language | Indentation in spaces
94+
:---: | :---: | :---:
95+
C# | csharp | 4
96+
HTML | html | 4
97+
CSS | css | 4
98+
JavaScript | javascript | 2 (4 spaces for line continuation)
99+
XML | xml | 2
100+
JSON | json | 2
101+
Console | console | 2
102+
Text | - | 2
87103
88104
## ASP.NET Core Specific Guidelines
89105
90106
- Use the latest supported version for examples unless otherwise specified
107+
- Title and section header casing is sentence case (capitalize the first word and any proper nouns)
108+
- For parts of a title or section header that normally use code style in article text (backticks around the content), also use code style in the title or section header (example H1 header: "# Modify the `Program.cs` file")
109+
- Use code style for any words that shouldn't be localized
110+
- For bullet lists, use an asterisk as the bullet marker
111+
- Bullet lists should have two or more entries at the same level in the list. If there is only one item under a bullet, remove its bullet marker and roll that item into its parent bullet.
91112
- Lead with Microsoft recommended approaches
92-
- Include differences between minimal API and controller-based approaches when relevant
93-
- For middleware, lead with the middleware class approach
113+
- Include differences between Minimal API and controller-based approaches when relevant
114+
- For middleware content and examples, use the middleware class approach
94115
- For Blazor, clearly distinguish between Server and WebAssembly hosting models
95116
96117
## Issue Handling

0 commit comments

Comments
 (0)