Skip to content

Commit 36a5ec9

Browse files
committed
🤖 Number 5 is alive!
0 parents  commit 36a5ec9

35 files changed

Lines changed: 2514 additions & 0 deletions

.editorconfig

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# EditorConfig is awesome:
2+
http://EditorConfig.org
3+
4+
5+
#### How to manually clean up code in an IDE?
6+
7+
#### - Visual Studio: CTRL + K + D
8+
#### - VSCode: SHIFT + ALT + F
9+
10+
11+
12+
####################################################################################################
13+
14+
### VS Settings Reference: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
15+
16+
17+
18+
19+
# top-most EditorConfig file
20+
root = true
21+
22+
# Default settings:
23+
# A newline ending every file
24+
# Use 4 spaces as indentation
25+
[*]
26+
insert_final_newline = true
27+
indent_style = space
28+
indent_size = 4
29+
end_of_line = crlf
30+
charset = utf-8
31+
trim_trailing_whitespace = true
32+
33+
# C# files
34+
[*.cs]
35+
# New line preferences
36+
csharp_new_line_before_open_brace = all
37+
csharp_new_line_before_else = true
38+
csharp_new_line_before_catch = true
39+
csharp_new_line_before_finally = true
40+
csharp_new_line_before_members_in_object_initializers = true
41+
csharp_new_line_before_members_in_anonymous_types = true
42+
csharp_new_line_between_query_expression_clauses = true
43+
44+
# Indentation preferences
45+
csharp_indent_block_contents = true
46+
csharp_indent_braces = false
47+
csharp_indent_case_contents = true
48+
csharp_indent_switch_labels = true
49+
csharp_indent_labels = one_less_than_current
50+
51+
# Namespace preferences
52+
csharp_style_namespace_declarations = file_scoped:error
53+
54+
# avoid this. unless absolutely necessary
55+
dotnet_style_qualification_for_field = false:suggestion
56+
dotnet_style_qualification_for_property = false:suggestion
57+
dotnet_style_qualification_for_method = false:suggestion
58+
dotnet_style_qualification_for_event = false:suggestion
59+
60+
# only use var when it's obvious what the variable type is
61+
csharp_style_var_for_built_in_types = true:suggestion
62+
csharp_style_var_when_type_is_apparent = true:suggestion
63+
csharp_style_var_elsewhere = true:suggestion
64+
65+
# use language keywords instead of BCL types
66+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
67+
dotnet_style_predefined_type_for_member_access = true:suggestion
68+
69+
# name all constant fields using PascalCase
70+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
71+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
72+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
73+
74+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
75+
dotnet_naming_symbols.constant_fields.required_modifiers = const
76+
77+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
78+
79+
# internal and private fields should be _camelCase
80+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
81+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
82+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
83+
84+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
85+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
86+
87+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
88+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
89+
90+
# Code style defaults
91+
dotnet_sort_system_directives_first = true
92+
csharp_preserve_single_line_blocks = true
93+
csharp_preserve_single_line_statements = false
94+
95+
# Expression-level preferences
96+
dotnet_style_object_initializer = true:suggestion
97+
dotnet_style_collection_initializer = true:suggestion
98+
dotnet_style_explicit_tuple_names = true:suggestion
99+
dotnet_style_coalesce_expression = true:suggestion
100+
dotnet_style_null_propagation = true:suggestion
101+
102+
# Expression-bodied members
103+
csharp_style_expression_bodied_methods = false:none
104+
csharp_style_expression_bodied_constructors = false:none
105+
csharp_style_expression_bodied_operators = false:none
106+
csharp_style_expression_bodied_properties = true:none
107+
csharp_style_expression_bodied_indexers = true:none
108+
csharp_style_expression_bodied_accessors = true:none
109+
110+
# Pattern matching
111+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
112+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
113+
csharp_style_inlined_variable_declaration = true:suggestion
114+
115+
# Null checking preferences
116+
csharp_style_throw_expression = true:suggestion
117+
csharp_style_conditional_delegate_call = true:suggestion
118+
119+
# Space preferences
120+
csharp_space_after_cast = false
121+
csharp_space_after_colon_in_inheritance_clause = true
122+
csharp_space_after_comma = true
123+
csharp_space_after_dot = false
124+
csharp_space_after_keywords_in_control_flow_statements = true
125+
csharp_space_after_semicolon_in_for_statement = true
126+
csharp_space_around_binary_operators = before_and_after
127+
csharp_space_around_declaration_statements = do_not_ignore
128+
csharp_space_before_colon_in_inheritance_clause = true
129+
csharp_space_before_comma = false
130+
csharp_space_before_dot = false
131+
csharp_space_before_open_square_brackets = false
132+
csharp_space_before_semicolon_in_for_statement = false
133+
csharp_space_between_empty_square_brackets = false
134+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
135+
csharp_space_between_method_call_name_and_opening_parenthesis = false
136+
csharp_space_between_method_call_parameter_list_parentheses = false
137+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
138+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
139+
csharp_space_between_method_declaration_parameter_list_parentheses = false
140+
csharp_space_between_parentheses = false
141+
csharp_space_between_square_brackets = false
142+
143+
[*.{asm,inc}]
144+
indent_size = 8
145+
146+
# Xml project files
147+
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
148+
indent_size = 2
149+
150+
# Xml config files
151+
[*.{props,targets,config,nuspec}]
152+
indent_size = 2
153+
154+
[CMakeLists.txt]
155+
indent_size = 2
156+
157+
[*.cmd]
158+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -text

.github/CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at help@world-domination.com.au. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

.github/CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# How to contribute
2+
3+
One of the easiest ways to contribute is to participate in discussions and discuss issues. You can also contribute by submitting pull requests with code changes.
4+
5+
## Filing issues
6+
- Don't be afraid to ask any question about the project, including suggestions to change how things currently are.
7+
- Keep the conversation polite and respectful. This way, all parties will take an interest in your question and will be more proactive into helping.
8+
- For bugs, the best way to get your bug fixed is to be as detailed as you can be about the problem. Providing a minimal project with steps to reproduce the problem is ideal. Even though this might be frustrating, it can speed up the resolution to the problem.
9+
10+
Helpful tip: GitHub supports [markdown](https://help.github.com/articles/github-flavored-markdown/), so when filing bugs make sure you check the formatting before clicking submit.
11+
12+
## Contributing code and content
13+
14+
**Identifying the scale**
15+
16+
If you would like to contribute to the project, first identify the "scale" of what you would like to contribute. If it is small (grammar/spelling or a bug fix) feel free to start working on a fix. If you are submitting a feature or substantial code contribution, please discuss it with the team, via an Issue.
17+
18+
You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all code submissions will be reviewed and tested by team members. Of course (where appropriate), tests will be required.
19+
20+
**Obtaining the source code**
21+
22+
If you are an outside contributer, please fork the repository to your own GitHub account. See the GitHub documentation for [forking a repo](https://help.github.com/articles/fork-a-repo/) if you have any questions about this.
23+
24+
**Submitting a Pull Request**
25+
26+
If you don't know what a Pull Request is read then please read the article [Using Pull Requests](https://help.github.com/articles/using-pull-requests) to get up-to-speed. Make sure the respository can build and all tests pass. Familiarize yourself with the project workflow and our coding conventions.
27+
28+
Pull Requests should all be done to the `main` branch.
29+
30+
**Commit/Pull Request Format**
31+
32+
```
33+
Summary of the changes (Less than 80 chars)
34+
- Detail 1
35+
- Detail 2
36+
37+
Addresses #bugnumber (in this specific format)
38+
```
39+
40+
**Tests**
41+
42+
- Tests need to be provided for every bug/feature that is completed.
43+
- Tests only need to be present for issues that need to be verified by QA (e.g. not tasks)
44+
- If there is a scenario that is far _too hard*_ to test there does not need to be a test for it.
45+
46+
47+
*"_Too hard_" is determined by the team as a whole.
48+
49+
---

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ['https://paypal.me/purekrome']

.github/copilot-instructions.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# GitHub Copilot Instructions
2+
3+
## Project Context
4+
5+
This is a project focused on two parts
6+
- A .NET website to observe the health of various servers that expose a standard schema. Intended use is via a docker instance
7+
- A list of projects (per language) that are easy to use libraries that expose that standard observability schema
8+
The codebase emphasizes simplicity, developer experience, and production-ready patterns
9+
10+
## Code Style & Standards
11+
12+
### General .NET Guidelines
13+
- Use modern C# features (pattern matching, records, nullable reference types, file-scoped namespaces)
14+
- Follow Microsoft's C# coding conventions (enforced via `.editorconfig`)
15+
- Prefer `async`/`await` for I/O operations
16+
- Use meaningful, descriptive names (avoid abbreviations unless widely known)
17+
- All comments should be in English and finish with a period
18+
19+
### Code Organization
20+
- Use file-scoped namespaces
21+
- One class per file (match filename to class name)
22+
- Group using statements (System namespaces first, then third-party, then local)
23+
- Order class members: fields, constructors, properties, methods (public before private)
24+
25+
### Error Handling
26+
- Use exceptions for exceptional cases, not control flow
27+
- Provide meaningful exception messages with context
28+
- Use guard clauses for parameter validation
29+
- Consider custom exceptions for domain-specific errors
30+
- Always validate input parameters (use ArgumentNullException, ArgumentException)
31+
32+
### Async/Await
33+
- Always use `ConfigureAwait(false)` in library code (not in ASP.NET Core endpoints)
34+
- Pass `CancellationToken` to all async methods
35+
- Don't use `.Result` or `.Wait()` - always await
36+
- Return `Task` or `Task<T>`, not `async void` (except event handlers)
37+
38+
### Logging
39+
- Use structured logging with ILogger
40+
- Include relevant context in log messages
41+
- Use appropriate log levels (Trace, Debug, Information, Warning, Error, Critical)
42+
- Log at method entry/exit for important operations
43+
- Include correlation IDs where applicable
44+
45+
### Testing
46+
- Write unit tests for all public APIs
47+
- Use xUnit as the testing framework and specifically xunit v3 using the latest Microsft Test Platform version
48+
- Follow AAA pattern (Arrange, Act, Assert)
49+
- Always comment in a test the "Arrange.", "Act.", and "Assert." sections
50+
- Use meaningful test names (e.g., `AddMessageAsync_WithLargeContent_StoresInBlob`)
51+
- Mock external dependencies (use Moq or NSubstitute)
52+
- Aim for high code coverage on business logic
53+
- Each method being tested should have it's own class to xunit can run tests in parallel
54+
- Each method being tested should have at least one test for success and one for failure
55+
56+
### Documentation
57+
- Use XML documentation comments for public APIs
58+
- Include `<summary>`, `<param>`, `<returns>`, and `<exception>` tags
59+
- Provide code examples in remarks when helpful
60+
- Keep README.md updated with examples
61+
- Document breaking changes in release notes
62+
63+
### Performance
64+
- Avoid allocations in hot paths
65+
- Use `Span<T>`, `Memory<T>`, and `ReadOnlySpan<T>` where appropriate
66+
- Consider object pooling for frequently allocated objects
67+
- Profile before optimizing
68+
- Use `ValueTask<T>` for high-performance scenarios
69+
70+
### Dependencies
71+
- Minimize external dependencies
72+
- Use well-maintained, popular NuGet packages
73+
- Keep packages up-to-date
74+
- Prefer Microsoft packages for common functionality
75+
- Review package licenses for compatibility
76+
77+
### Design Patterns
78+
- Favor composition over inheritance
79+
- Use dependency injection
80+
- Apply SOLID principles
81+
- Keep classes focused (Single Responsibility Principle)
82+
- Program to interfaces, not implementations
83+
- Use builder pattern for complex object construction
84+
85+
### Records and Data Types
86+
- Use `record` for DTOs and immutable data
87+
- Use `readonly struct` for small, immutable value types
88+
- Prefer immutability where possible
89+
- Use nullable reference types (`?`) appropriately
90+
91+
### API Design
92+
- Keep public API surface small and focused
93+
- Make it hard to use incorrectly (pit of success)
94+
- Provide async methods for I/O operations
95+
- Accept interfaces in constructors, return concrete types
96+
- Version APIs carefully to avoid breaking changes
97+
98+
## What NOT to Do
99+
100+
- ❌ Don't ignore CA (Code Analysis) warnings without justification
101+
- ❌ Don't commit commented-out code
102+
- ❌ Don't use magic numbers/strings (use constants)
103+
- ❌ Don't catch generic exceptions without rethrowing
104+
- ❌ Don't use `Thread.Sleep` in async code (use `Task.Delay`)
105+
- ❌ Don't expose internal implementation details in public APIs
106+
- ❌ Don't write methods longer than ~50 lines (refactor into smaller methods)
107+
- ❌ Don't use regions to hide code
108+
- ❌ Don't use dynamic types
109+
- ❌ Don't use static classes for stateful operations
110+
- ❌ Don't use Automapper or MediatR
111+
112+
## Code Review Checklist
113+
114+
When reviewing code suggestions, ensure:
115+
- [ ] Code follows project conventions
116+
- [ ] All public APIs have XML documentation
117+
- [ ] Async methods use `CancellationToken`
118+
- [ ] Proper exception handling is in place
119+
- [ ] Tests are included for new functionality
120+
- [ ] No hardcoded values (use configuration)
121+
- [ ] Logging is appropriate and structured
122+
- [ ] Performance implications are considered
123+
- [ ] Breaking changes are documented
124+
125+
## Additional Context
126+
127+
- This project prioritizes **simplicity** and **developer experience**
128+
- Code should be self-documenting where possible
129+
- Favor clarity over cleverness
130+
- Consider the library consumer's perspective
131+
- Maintain backward compatibility when possible

0 commit comments

Comments
 (0)