Skip to content

Commit cfef610

Browse files
committed
Work in progress
0 parents  commit cfef610

File tree

158 files changed

+11106
-0
lines changed

Some content is hidden

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

158 files changed

+11106
-0
lines changed

.editorconfig

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# EditorConfig: https://EditorConfig.org
2+
3+
root = true
4+
5+
# All Files
6+
[*]
7+
charset = utf-8
8+
indent_style = space
9+
indent_size = 4
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
vsspell_section_id = main
13+
vsspell_ignored_words_main = File:dictionary.dic
14+
15+
# XML Configuration Files
16+
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog,runsettings}]
17+
indent_size = 2
18+
19+
# JSON Files
20+
[*.{json,json5,webmanifest}]
21+
indent_size = 2
22+
23+
# Project Files
24+
[*.{csproj,sqlproj}]
25+
indent_size = 2
26+
27+
# YAML Files
28+
[*.{yml,yaml}]
29+
indent_size = 2
30+
31+
# Markdown Files
32+
[*.md]
33+
trim_trailing_whitespace = false
34+
35+
# Web Files
36+
[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,pcss,svg,vue}]
37+
indent_size = 2
38+
39+
# Batch Files
40+
[*.{cmd,bat}]
41+
end_of_line = crlf
42+
43+
# Bash Files
44+
[*.sh]
45+
end_of_line = lf
46+
47+
[*.{cs,vb}]
48+
dotnet_sort_system_directives_first = true
49+
dotnet_separate_import_directive_groups = true
50+
dotnet_style_namespace_match_folder = true
51+
52+
[*.cs]
53+
csharp_using_directive_placement = outside_namespace
54+
csharp_style_namespace_declarations = file_scoped:warning

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/copilot-instructions.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Foundatio.Mediator – AI agent guide
2+
3+
Use this when coding in this repo. Keep advice specific; reference files/paths.
4+
5+
## Key Principles
6+
7+
All contributions must respect existing formatting and conventions specified in the `.editorconfig` file. You are a distinguished engineer and are expected to deliver high-quality code that adheres to the guidelines in the instruction files.
8+
9+
Let's keep pushing for clarity, usability, and excellence—both in code and user experience.
10+
11+
**See also:**
12+
13+
- [General Coding Guidelines](instructions/general.instructions.md)
14+
- [Testing Guidelines](instructions/testing.instructions.md)
15+
16+
## Commenting style
17+
- Keep comments to a minimum.
18+
- Only add comments when intent is not obvious or when explaining complex logic, tricky edge cases, or non-trivial performance/interop considerations.
19+
- Prefer clear naming and small, self-explanatory functions over explanatory comments.
20+
- Avoid boilerplate and restating what the code already says.
21+

.github/dependabot.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "01:00"
8+
timezone: "America/Chicago"
9+
open-pull-requests-limit: 10
10+
11+
- package-ecosystem: nuget
12+
directory: "/"
13+
schedule:
14+
interval: daily
15+
time: "02:00"
16+
timezone: "America/Chicago"
17+
open-pull-requests-limit: 10
18+
groups:
19+
Azure:
20+
patterns:
21+
- "Azure.*"
22+
- "Microsoft.Azure.*"
23+
- "Microsoft.Extensions.Azure"
24+
AspNetCoreHealthChecks:
25+
patterns:
26+
- "AspNetCore.HealthChecks.*"
27+
AspNetCore:
28+
patterns:
29+
- "Microsoft.AspNetCore.*"
30+
- "Microsoft.Extensions.Features"
31+
MicrosoftExtensions:
32+
patterns:
33+
- "Microsoft.Extensions.*"
34+
EntityFrameworkCore:
35+
patterns:
36+
- "Microsoft.EntityFrameworkCore.*"
37+
OpenTelemetry:
38+
patterns:
39+
- "OpenTelemetry.*"
40+
Serilog:
41+
patterns:
42+
- "Serilog"
43+
- "Serilog.*"
44+
Hangfire:
45+
patterns:
46+
- "Hangfire"
47+
- "Hangfire.*"
48+
Testcontainers:
49+
patterns:
50+
- "Testcontainers.*"
51+
xUnit:
52+
patterns:
53+
- "xunit"
54+
- "xunit.assert"
55+
- "xunit.core"
56+
- "xunit.extensibility.*"
57+
- "xunit.runner.*"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
description: "General coding guidelines"
3+
applyTo: "**"
4+
---
5+
6+
# General Coding Guidelines
7+
8+
You are a distinguished engineer and are expected to deliver high-quality code that adheres to the guidelines below.
9+
All contributions must respect existing formatting and conventions specified in the `.editorconfig` file and
10+
Microsoft's [coding conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions).
11+
12+
Code can be formatted with `dotnet format` and checked for errors with `dotnet build`.
13+
14+
Use context7 for documentation
15+
16+
## Code Style & Minimal Diffs
17+
18+
- Match the file's existing style; use `.editorconfig` when unsure.
19+
- Preserve extra spaces, comments, and minimize diffs.
20+
- Always ask before creating new files, directories, or changing existing structures.
21+
- Always look at existing usages before refactoring or changing code to prevent new code from breaking existing code.
22+
- Assume any existing uncommitted code is correct and ask before changing it.
23+
- Don't add code comments unless necessary. Code should be self-explanatory.
24+
- Don't use deprecated or insecure libraries, algorithms or features.
25+
26+
## Modern Code Practices
27+
28+
- Write complete, runnable code—no placeholders or TODOs.
29+
- Use modern language features, clear naming conventions, and defensive coding when necessary.
30+
- Follow SOLID, DRY, and clean code principles. Remove unused code.
31+
32+
## Behavior Management
33+
34+
- Flag any user-visible changes for review.
35+
- Deliver exactly what's requested—avoid adding unnecessary features unless explicitly instructed.
36+
37+
## Security Guidelines
38+
39+
- Sanitize all user inputs and rigorously validate data.
40+
- Follow OWASP guidelines and implement a robust Content Security Policy.
41+
- Adopt Shift-Left security practices to identify vulnerabilities early.
42+
43+
## Developer Planning & Reflection
44+
45+
### Pre-Coding Reflection
46+
47+
1. Identify the problem or feature you're solving.
48+
2. Consider three possible approaches.
49+
3. Choose the simplest approach that satisfies all requirements.
50+
4. Clarify:
51+
- Can the solution be modularized into smaller functions?
52+
- Are there unnecessary abstractions?
53+
- Will the implementation be clear to a junior developer?
54+
55+
### Post-Coding Reflection
56+
57+
1. Review for refactor opportunities—can clarity or maintainability be improved?
58+
2. Identify potential edge cases or areas prone to bugs.
59+
3. Verify robust error handling and validation mechanisms.
60+
61+
## Code Reviews
62+
63+
- Ensure adherence to complexity, consistency, and clean code standards.
64+
- Validate robust error handling and defensive coding practices.
65+
- Check for duplication and maintainable solutions.
66+
67+
## Debugging Guidelines
68+
69+
1. **Reproduce** the issue with minimal steps and code.
70+
2. **Understand** the underlying problem thoroughly.
71+
3. **Form Hypotheses** about the cause.
72+
4. **Test & Verify** potential solutions.
73+
5. **Document** fixes and adjustments clearly for future reference.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
description: "C# testing guidelines"
3+
applyTo: "tests/**/*.cs"
4+
---
5+
6+
# Testing Guidelines (C#)
7+
8+
## Framework & Best Practices
9+
10+
- Follow Microsoft's [unit testing best practices](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices).
11+
- Use xUnit as the primary testing framework.
12+
- Use AwesomeAssertions for fluent assertions.
13+
14+
## Test Principles
15+
16+
- **Fast & Isolated**: Tests should execute quickly and not depend on external factors or the order of execution.
17+
- **Repeatable & Self-Checking**: Tests must be consistent and validate their own outcomes without manual checks.
18+
- **Timely**: Write tests alongside your code to ensure relevance and improve design.
19+
20+
## Test Structure & Naming
21+
22+
- Write complete, runnable tests—no placeholders or TODOs.
23+
- Use clear, descriptive naming conventions for test methods:
24+
- `MethodName_StateUnderTest_ExpectedBehavior`
25+
- Follow AAA pattern (Arrange, Act, Assert).
26+
27+
## Test Organization
28+
29+
- Use `[Theory]` and `[InlineData]` for parameterized tests.
30+
- Implement proper setup and teardown using constructors and `IDisposable`.
31+
- Tests are organized to mirror the main code structure (e.g., `Storage/` in both `src` and `tests`).
32+
33+
## Integration Testing
34+
35+
- Inject `ITestOutputHelper` into the test class constructor to get access to the test output.
36+
- Isolate dependencies using test containers, in-memory providers, or stubs to ensure reliable test execution.
37+
- Verify data persistence and side effects.

0 commit comments

Comments
 (0)