Skip to content

Commit b842d06

Browse files
committed
2 parents 814aaac + cd124c8 commit b842d06

File tree

617 files changed

+67207
-62962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

617 files changed

+67207
-62962
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# editorconfig.org
1+
# editorconfig.org
22

33
# top-most EditorConfig file
44
root = true
@@ -80,6 +80,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
8080

8181
# Code style defaults
8282
csharp_using_directive_placement = outside_namespace:suggestion
83+
csharp_style_namespace_declarations = file_scoped:warning
8384
dotnet_sort_system_directives_first = true
8485
csharp_prefer_braces = true:silent
8586
csharp_preserve_single_line_blocks = true:none

.github/copilot-instructions.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## General
2+
3+
* Make only high confidence suggestions when reviewing code changes.
4+
* Always use the latest version C#, currently C# 13 features.
5+
* Do not use preview language features.
6+
* Never change .editorconfig files unless explicitly asked to.
7+
* Never change .gitignore files unless explicitly asked to.
8+
* Never change global.json unless explicitly asked to.
9+
* Never change Directory.Build.props or Directory.Build.targets files unless explicitly asked to.
10+
* Never change Directory.Packages.props files unless explicitly asked to.
11+
* Never change package.json or package-lock.json files unless explicitly asked to.
12+
* Never change NuGet.config files unless explicitly asked to.
13+
14+
* Apply code-formatting style defined in `.editorconfig`.
15+
* Prefer file-scoped namespace declarations and single-line using directives.
16+
* Insert a newline before the opening curly brace of any code block (e.g., after `if`, `for`, `while`, `foreach`, `using`, `try`, etc.).
17+
* Ensure that the final return statement of a method is on its own line.
18+
* Use pattern matching and switch expressions wherever possible.
19+
* Use `nameof` instead of string literals when referring to member names.
20+
* Ensure that XML doc comments are created for any public APIs.
21+
* When adding XML documentation to APIs, follow the guidelines at [`docs.prompt.md`](/.github/prompts/docs.prompt.md).
22+
* Prefer `?.` if applicable (e.g. `scope?.Dispose()`).
23+
* Use `ObjectDisposedException.ThrowIf` where applicable.
24+
25+
**Any code you commit MUST compile, and new and existing tests related to the change MUST pass.**
26+
27+
You MUST make your best effort to ensure any code changes satisfy those criteria before committing. If for any reason you were unable to build or test code changes, you MUST report that. You MUST NOT claim success unless all builds and tests pass as described above.
28+
29+
If you make code changes, do not complete without checking the relevant code builds and relevant tests still pass after the last edits you make. Do not simply assume that your changes fix test failures you see, actually build and run those tests again to confirm.
30+
31+
### Nullable Reference Types
32+
33+
* Declare variables non-nullable, and check for `null` at entry points.
34+
* Always use `is null` or `is not null` instead of `== null` or `!= null`.
35+
* Trust the C# null annotations and don't add null checks when the type system says a value cannot be null.
36+
37+
### Testing
38+
39+
* We use xUnit SDK v3 for tests.
40+
* Do not emit "Act", "Arrange" or "Assert" comments.
41+
* Copy existing style in nearby files for test method names and capitalization.
42+
* When writing tests, prefer using `[Theory]` with multiple data sources (like `[InlineData]` or `[MemberData]`) over multiple duplicative `[Fact]` methods. Fewer test methods that validate more inputs are better than many similar test methods.*
43+
44+
## Running tests
45+
46+
* To build and run tests in the repo use dotnet test command from the root of the repository.

.github/prompts/docs.prompt.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
agent: 'agent'
3+
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'read/problems']
4+
description: 'Ensure that C# types are documented with XML comments and follow best practices for documentation.'
5+
---
6+
7+
# C# Documentation Best Practices
8+
9+
- Public members should be documented with XML comments.
10+
- It is encouraged to document internal members as well, especially if they are complex or not self-explanatory.
11+
12+
## Guidance for all APIs
13+
14+
- Use `<summary>` to provide a brief, one sentence, description of what the type or member does. Start the summary with a present-tense, third-person verb.
15+
- Use `<remarks>` for additional information, which can include implementation details, usage notes, or any other relevant context.
16+
- Use `<see langword>` for language-specific keywords like `null`, `true`, `false`, `int`, `bool`, etc.
17+
- Use `<c>` for inline code snippets.
18+
- Use `<example>` for usage examples on how to use the member.
19+
- Use `<code>` for code blocks. `<code>` tags should be placed within an `<example>` tag. Add the language of the code example using the `language` attribute, for example, `<code language="csharp">`.
20+
- Use `<see cref>` to reference other types or members inline (in a sentence).
21+
- Use `<seealso>` for standalone (not in a sentence) references to other types or members in the "See also" section of the online docs.
22+
- Use `<inheritdoc/>` to inherit documentation from base classes or interfaces.
23+
- Unless there is major behavior change, in which case you should document the differences.
24+
25+
## Methods
26+
27+
- Use `<param>` to describe method parameters.
28+
- The description should be a noun phrase that doesn't specify the data type.
29+
- Begin with an introductory article.
30+
- If the parameter is a flag enum, start the description with "A bitwise combination of the enumeration values that specifies...".
31+
- If the parameter is a non-flag enum, start the description with "One of the enumeration values that specifies...".
32+
- If the parameter is a Boolean, the wording should be of the form "`<see langword="true" />` to ...; otherwise, `<see langword="false" />`.".
33+
- If the parameter is an "out" parameter, the wording should be of the form "When this method returns, contains .... This parameter is treated as uninitialized.".
34+
- Use `<paramref>` to reference parameter names in documentation.
35+
- Use `<typeparam>` to describe type parameters in generic types or methods.
36+
- Use `<typeparamref>` to reference type parameters in documentation.
37+
- Use `<returns>` to describe what the method returns.
38+
- The description should be a noun phrase that doesn't specify the data type.
39+
- Begin with an introductory article.
40+
- If the return type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`.".
41+
42+
## Constructors
43+
44+
- The summary wording should be "Initializes a new instance of the <Class> class [or struct].".
45+
46+
## Properties
47+
48+
- The `<summary>` should start with:
49+
- "Gets or sets..." for a read-write property.
50+
- "Gets..." for a read-only property.
51+
- "Gets [or sets] a value that indicates whether..." for properties that return a Boolean value.
52+
- Use `<value>` to describe the value of the property.
53+
- The description should be a noun phrase that doesn't specify the data type.
54+
- If the property has a default value, add it in a separate sentence, for example, "The default is `<see langword="false" />`".
55+
- If the value type is Boolean, the wording should be of the form "`<see langword="true" />` if ...; otherwise, `<see langword="false" />`. The default is ...".
56+
57+
## Exceptions
58+
59+
- Use `<exception cref>` to document exceptions thrown by constructors, properties, indexers, methods, operators, and events.
60+
- Document all exceptions thrown directly by the member.
61+
- For exceptions thrown by nested members, document only the exceptions users are most likely to encounter.
62+
- The description of the exception describes the condition under which it's thrown.
63+
- Omit "Thrown if ..." or "If ..." at the beginning of the sentence. Just state the condition directly, for example "An error occurred when accessing a Message Queuing API."

.github/workflows/actions-security-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
21+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2222
with:
2323
egress-policy: audit
2424

.github/workflows/ci-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
push:
66
branches:
77
- 'main'
8+
- 'version/*'
89
paths-ignore:
910
- 'docs/**'
1011
- '.github/**'
1112
pull_request:
1213
branches:
1314
- 'main'
15+
- 'version/*'
1416

1517
permissions:
1618
contents: read
@@ -32,7 +34,7 @@ jobs:
3234
checks: write
3335
steps:
3436
- name: 'Harden Runner'
35-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
37+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3638
with:
3739
egress-policy: audit
3840

.github/workflows/close-inactive-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write
1515
steps:
1616
- name: Harden Runner
17-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
17+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
1818
with:
1919
egress-policy: audit
2020

.github/workflows/codeql-analysis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
name: CodeQL Scan
1+
name: CodeQL Scan
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- main
8+
- version/*
89
paths-ignore:
9-
- 'docs/**'
1010
- '.github/**'
1111
pull_request:
1212
# The branches below must be a subset of the branches above
13-
branches: [ main ]
13+
branches:
14+
- main
15+
- version/*
1416
schedule:
1517
- cron: '25 4 * * 2'
1618

@@ -40,7 +42,7 @@ jobs:
4042

4143
steps:
4244
- name: Harden Runner
43-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
45+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
4446
with:
4547
egress-policy: audit
4648

@@ -58,7 +60,7 @@ jobs:
5860
5961
# Initializes the CodeQL tools for scanning.
6062
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
63+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
6264
with:
6365
languages: ${{ matrix.language }}
6466

@@ -69,4 +71,4 @@ jobs:
6971
run: dotnet build --configuration CodeQL /p:UseSharedCompilation=false /t:rebuild
7072

7173
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
74+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
pull_request:
66
branches:
77
- 'main'
8+
- 'version/*'
89

910
permissions:
1011
contents: read
@@ -14,7 +15,7 @@ jobs:
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Harden Runner
17-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
18+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
1819
with:
1920
egress-policy: audit
2021

.github/workflows/generate-publish-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Harden Runner
36-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
36+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3737
with:
3838
egress-policy: audit
3939

@@ -50,7 +50,7 @@ jobs:
5050
run: dotnet build --configuration Release --property:PublicRelease=true
5151

5252
- name: 'Generate docs'
53-
run: dotnet dnx docfx .\docs\docfx.json -y
53+
run: dotnet dnx docfx ./docs/docfx.json -y
5454

5555
- name: Upload Pages Artifact
5656
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
@@ -60,4 +60,4 @@ jobs:
6060

6161
- name: Deploy to GitHub Pages
6262
id: deployment
63-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
63+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

.github/workflows/openssf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Harden Runner
37-
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
37+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
3838
with:
3939
egress-policy: audit
4040

@@ -78,6 +78,6 @@ jobs:
7878
# Upload the results to GitHub's code scanning dashboard (optional).
7979
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
8080
- name: "Upload to code-scanning"
81-
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
81+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
8282
with:
8383
sarif_file: results.sarif

0 commit comments

Comments
 (0)