Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": "0.2",
"language": "en",
"words": [
"camelcase",
"cspell",
"csproj",
"dbproj",
"Dema",
"dependabot",
"dotnet",
"editorconfig",
"fsproj",
"Gidget",
"gitattributes",
"LINQ",
"markdownlint",
"mstest",
"nuget",
"nupkg",
"SBOM",
"semver",
"snupkg",
"Sonar",
"sonarcloud",
"spdx",
"TestResults",
"trx",
"vbproj",
"vcxproj"
],
"ignorePaths": [
"node_modules",
".git",
"bin",
"obj",
"*.nupkg",
"*.snupkg",
"*.dll",
"*.exe",
"*.trx",
"*.spdx.json",
"package-lock.json",
"yarn.lock"
]
}
173 changes: 173 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# YAML files
[*.{yml,yaml}]
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false

# Shell scripts
[*.sh]
end_of_line = lf

# Batch files
[*.{cmd,bat}]
end_of_line = crlf

# Dotnet code style settings:
[*.{cs,vb}]

# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = warning

# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# Naming conventions
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = warning
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

# CSharp code style settings:
[*.cs]

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents_when_block = false

# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_after_comma = true
csharp_space_after_dot = false

# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Code quality rules
dotnet_code_quality_unused_parameters = all:warning

52 changes: 52 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Auto detect text files and perform LF normalization
* text=auto

# Source code
*.cs text diff=csharp
*.csx text diff=csharp
*.vb text

# Project files
*.csproj text
*.vbproj text
*.fsproj text
*.dbproj text
*.sln text eol=crlf

# Configuration files
*.config text
*.json text
*.xml text
*.yaml text
*.yml text

# Documentation
*.md text
*.txt text

# Scripts
*.sh text eol=lf
*.bash text eol=lf
*.ps1 text eol=crlf
*.cmd text eol=crlf
*.bat text eol=crlf

# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg text

# Archives
*.zip binary
*.gz binary
*.tar binary
*.nupkg binary
*.snupkg binary

# Other binaries
*.dll binary
*.exe binary
*.pdb binary
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
# Maintain dependencies for NuGet
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
groups:
analyzers:
patterns:
- "Microsoft.CodeAnalysis.*"
- "SonarAnalyzer.*"
test-dependencies:
patterns:
- "Microsoft.NET.Test.Sdk"
- "MSTest.*"
- "coverlet.*"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
28 changes: 28 additions & 0 deletions .github/workflows/build_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,35 @@ on:
- cron: '0 17 * * 1'

jobs:
quality-checks:
name: Quality Checks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install cspell
run: npm install -g cspell

- name: Install markdownlint-cli
run: npm install -g markdownlint-cli

- name: Run spell checker
run: cspell "**/*.{md,cs}" --no-progress

- name: Run markdown linter
run: markdownlint "**/*.md" --ignore node_modules

build-windows:
name: Build Windows
needs: quality-checks
permissions:
contents: read # To read repository contents
pull-requests: write # To write pull requests analysis results and artifacts
Expand All @@ -22,6 +49,7 @@ jobs:

build-linux:
name: Build Linux
needs: quality-checks
permissions:
contents: read # To read repository contents
pull-requests: write # To write pull requests analysis results and artifacts
Expand Down
15 changes: 15 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"default": true,
"MD013": {
"line_length": 120,
"heading_line_length": 120,
"code_block_line_length": 120,
"code_blocks": true,
"tables": false,
"headings": true,
"strict": false,
"stern": false
},
"MD033": false,
"MD041": false
}
Loading