You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,13 @@ This document contains repository-specific instructions for GitHub Copilot when
15
15
- Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
16
16
-**Repository Exceptions**:
17
17
- 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)
19
20
- 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.
20
21
- For any new .md file added to the repository or any updated .md file ensure the following frontmatter (meta data) is included.
21
22
- 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.
23
25
24
26
## Version Targeting
25
27
@@ -83,14 +85,33 @@ This document contains repository-specific instructions for GitHub Copilot when
- 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
87
103
88
104
## ASP.NET Core Specific Guidelines
89
105
90
106
- 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.
91
112
- 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
94
115
- For Blazor, clearly distinguish between Server and WebAssembly hosting models
0 commit comments