Skip to content

Commit ace053e

Browse files
committed
Initial commit
0 parents  commit ace053e

28 files changed

Lines changed: 1566 additions & 0 deletions

.editorconfig

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# YAML files
24+
[*.{yaml,yml}]
25+
indent_size = 2
26+
27+
# JSON files
28+
[*.json]
29+
indent_size = 2
30+
31+
# Dotnet code style settings:
32+
[*.{cs,vb}]
33+
tab_width = 4
34+
35+
# Sort using and Import directives with System.* appearing first
36+
dotnet_sort_system_directives_first = true
37+
# Avoid "this." and "Me." if not necessary
38+
dotnet_style_qualification_for_field = false:suggestion
39+
dotnet_style_qualification_for_property = false:suggestion
40+
dotnet_style_qualification_for_method = false:suggestion
41+
dotnet_style_qualification_for_event = false:suggestion
42+
43+
# Use language keywords instead of framework type names for type references
44+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
45+
dotnet_style_predefined_type_for_member_access = true:suggestion
46+
47+
# Suggest more modern language features when available
48+
dotnet_style_object_initializer = true:suggestion
49+
dotnet_style_collection_initializer = true:suggestion
50+
dotnet_style_coalesce_expression = true:suggestion
51+
dotnet_style_null_propagation = true:suggestion
52+
dotnet_style_explicit_tuple_names = true:suggestion
53+
54+
# CSharp code style settings:
55+
56+
# IDE0040: Add accessibility modifiers
57+
dotnet_style_require_accessibility_modifiers = omit_if_default:error
58+
59+
# IDE0040: Add accessibility modifiers
60+
dotnet_diagnostic.IDE0040.severity = error
61+
62+
# IDE1100: Error reading content of source file 'Project.TargetFrameworkMoniker' (i.e. from ThisAssembly)
63+
dotnet_diagnostic.IDE1100.severity = none
64+
65+
[*.cs]
66+
# Top-level files are definitely OK
67+
csharp_using_directive_placement = outside_namespace:silent
68+
csharp_style_namespace_declarations = block_scoped:silent
69+
csharp_prefer_simple_using_statement = true:suggestion
70+
csharp_prefer_braces = true:silent
71+
72+
# Prefer "var" everywhere
73+
csharp_style_var_for_built_in_types = true:suggestion
74+
csharp_style_var_when_type_is_apparent = true:suggestion
75+
csharp_style_var_elsewhere = true:suggestion
76+
77+
# Prefer method-like constructs to have an expression-body
78+
csharp_style_expression_bodied_methods = true:none
79+
csharp_style_expression_bodied_constructors = true:none
80+
csharp_style_expression_bodied_operators = true:none
81+
82+
# Prefer property-like constructs to have an expression-body
83+
csharp_style_expression_bodied_properties = true:none
84+
csharp_style_expression_bodied_indexers = true:none
85+
csharp_style_expression_bodied_accessors = true:none
86+
87+
# Suggest more modern language features when available
88+
csharp_style_pattern_matching_over_is_with_cast_check = true:error
89+
csharp_style_pattern_matching_over_as_with_null_check = true:error
90+
csharp_style_inlined_variable_declaration = true:suggestion
91+
csharp_style_throw_expression = true:suggestion
92+
csharp_style_conditional_delegate_call = true:suggestion
93+
94+
# Newline settings
95+
csharp_new_line_before_open_brace = all
96+
csharp_new_line_before_else = true
97+
csharp_new_line_before_catch = true
98+
csharp_new_line_before_finally = true
99+
csharp_new_line_before_members_in_object_initializers = true
100+
csharp_new_line_before_members_in_anonymous_types = true
101+
102+
# Test settings
103+
[**/*Tests*/**{.cs,.vb}]
104+
# xUnit1013: Public method should be marked as test. Allows using records as test classes
105+
dotnet_diagnostic.xUnit1013.severity = none
106+
107+
# CS9113: Parameter is unread (usually, ITestOutputHelper)
108+
dotnet_diagnostic.CS9113.severity = none
109+
110+
# Default severity for analyzer diagnostics with category 'Style'
111+
dotnet_analyzer_diagnostic.category-Style.severity = none
112+
113+
# VSTHRD200: Use "Async" suffix for async methods
114+
dotnet_diagnostic.VSTHRD200.severity = none

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# normalize by default
2+
* text=auto encoding=UTF-8
3+
*.sh text eol=lf
4+
*.sbn eol=lf
5+
6+
# These are windows specific files which we may as well ensure are
7+
# always crlf on checkout
8+
*.bat text eol=crlf
9+
*.cmd text eol=crlf

.github/copilot-instructions.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# .NET Repository
2+
3+
**Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
4+
5+
## Working Effectively
6+
7+
### Essential Build Commands
8+
- **Restore dependencies**: `dotnet restore`
9+
10+
- **Build the entire solution**: `dotnet build`
11+
12+
- **Run tests**: `dnx --yes retest`
13+
- Runs all unit tests across the solution
14+
- If tests fail due to Azure Storage, run the following commands and retry: `npm install azurite` and `npx azurite &`
15+
16+
### Build Validation and CI Requirements
17+
- **Always run before committing**:
18+
* `dnx --yes retest`
19+
* `dotnet format whitespace -v:diag --exclude ~/.nuget`
20+
* `dotnet format style -v:diag --exclude ~/.nuget`
21+
22+
### Project Structure and Navigation
23+
24+
| Directory | Description |
25+
|-----------|-------------|
26+
| `src/` | Contains the repo source code. |
27+
| `bin/` | Contains built packages (if any) |
28+
29+
### Code Style and Formatting
30+
31+
#### EditorConfig Rules
32+
The repository uses `.editorconfig` at the repo root for consistent code style.
33+
34+
- **Indentation**: 4 spaces for C# files, 2 spaces for XML/YAML/JSON
35+
- **Line endings**: LF (Unix-style)
36+
- **Sort using directives**: System.* namespaces first (`dotnet_sort_system_directives_first = true`)
37+
- **Type references**: Prefer language keywords over framework type names (`int` vs `Int32`)
38+
- **Modern C# features**: Use object/collection initializers, coalesce expressions when possible, use var when the type is apparent from the right-hand side of the assignment
39+
- **Visibility modifiers**: only explicitly specify visibility when different from the default (e.g. `public` for classes, no `internal` for classes or `private` for fields, etc.)
40+
41+
#### Formatting Validation
42+
- CI enforces formatting with `dotnet format whitespace` and `dotnet format style`
43+
- Run locally: `dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget`
44+
- Fix formatting: `dotnet format` (without `--verify-no-changes`)
45+
46+
### Testing Practices
47+
48+
#### Test Framework
49+
- **xUnit** for all unit and integration tests
50+
- **Moq** for mocking dependencies
51+
- Located in `src/*.Tests/`
52+
53+
#### Test Attributes
54+
Custom xUnit attributes are sometimes used for conditional test execution:
55+
- `[SecretsFact("XAI_API_KEY")]` - Skips test if required secrets are missing from user secrets or environment variables
56+
- `[LocalFact("SECRET")]` - Runs only locally (skips in CI), requires specified secrets
57+
- `[CIFact]` - Runs only in CI environment
58+
59+
### Dependency Management
60+
61+
#### Adding Dependencies
62+
- Add to appropriate `.csproj` file
63+
- Run `dotnet restore` to update dependencies
64+
- Ensure version consistency across projects where applicable
65+
66+
#### CI/CD Pipeline
67+
- **Build workflow**: `.github/workflows/build.yml` - runs on PR and push to main/rel/feature branches
68+
- **Publish workflow**: Publishes to Sleet feed when `SLEET_CONNECTION` secret is available
69+
- **OS matrix**: Configured in `.github/workflows/os-matrix.json` (defaults to ubuntu-latest)
70+
71+
### Special Files and Tools
72+
73+
#### dnx Command
74+
- **Purpose**: built-in tool for running arbitrary dotnet tools that are published on nuget.org. `--yes` auto-confirms install before run.
75+
- **Example**: `dnx --yes retest` - runs tests with automatic retry on transient failures (retest being a tool package published at https://www.nuget.org/packages/retest)
76+
- **In CI**: `dnx --yes retest -- --no-build` (skips build, runs tests only)
77+
78+
#### Directory.Build.rsp
79+
- MSBuild response file with default build arguments
80+
- `-nr:false` - disables node reuse
81+
- `-m:1` - single-threaded build (for stability)
82+
- `-v:m` - minimal verbosity
83+
84+
#### Code Quality
85+
- All PRs must pass format validation
86+
- Tests must pass on all target frameworks
87+
- Follow existing patterns and conventions in the codebase
88+
89+
## Documenting Work
90+
91+
Project implemention details, design and key decisions should be documented in a top-level AGENTS.md file at the repo root.
92+
Keep this file updated whenever you make change significant changes for future reference.
93+
94+
User-facing features and APIs should be documented to highlight (not extensively, as an overview) key project features and capabilities, in the readme.md file at the repo root.

.github/dependabot.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: nuget
7+
directory: /
8+
schedule:
9+
interval: daily
10+
groups:
11+
Azure:
12+
patterns:
13+
- "Azure*"
14+
- "Microsoft.Azure*"
15+
Identity:
16+
patterns:
17+
- "System.IdentityModel*"
18+
- "Microsoft.IdentityModel*"
19+
System:
20+
patterns:
21+
- "System*"
22+
exclude-patterns:
23+
- "System.IdentityModel*"
24+
Extensions:
25+
patterns:
26+
- "Microsoft.Extensions*"
27+
exclude-patterns:
28+
- "Microsoft.Extensions.AI*"
29+
ExtensionsAI:
30+
patterns:
31+
- "Microsoft.Extensions.AI*"
32+
Web:
33+
patterns:
34+
- "Microsoft.AspNetCore*"
35+
OpenTelemetry:
36+
patterns:
37+
- "OpenTelemetry*"
38+
Tests:
39+
patterns:
40+
- "Microsoft.NET.Test*"
41+
- "xunit*"
42+
- "coverlet*"
43+
ThisAssembly:
44+
patterns:
45+
- "ThisAssembly*"
46+
ProtoBuf:
47+
patterns:
48+
- "protobuf-*"
49+
Spectre:
50+
patterns:
51+
- "Spectre.Console*"

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- bydesign
5+
- dependencies
6+
- duplicate
7+
- question
8+
- invalid
9+
- wontfix
10+
- need info
11+
- techdebt
12+
authors:
13+
- devlooped-bot
14+
- dependabot
15+
- github-actions
16+
categories:
17+
- title: ✨ Implemented enhancements
18+
labels:
19+
- enhancement
20+
- title: 🐛 Fixed bugs
21+
labels:
22+
- bug
23+
- title: 📝 Documentation updates
24+
labels:
25+
- docs
26+
- documentation
27+
- title: 🔨 Other
28+
labels:
29+
- '*'
30+
exclude:
31+
labels:
32+
- dependencies

0 commit comments

Comments
 (0)