Skip to content

Commit bc96db7

Browse files
authored
Seal and Cleanup Classes (#49)
2 parents 99ef32f + 7b00ce2 commit bc96db7

724 files changed

Lines changed: 10482 additions & 1342 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,4 @@ dotnet_diagnostic.SA1650.severity = none # Element documentation shou
310310
dotnet_diagnostic.SA1651.severity = none # Do not use placeholder elements.
311311

312312
# IDE0290: Use primary constructor
313-
dotnet_diagnostic.IDE0290.severity = none
313+
dotnet_diagnostic.IDE0290.severity = none

.github/copilot-instructions.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,37 @@ Keep the docs focused on `CrestApps.Core`. If you need to mention the Orchard Co
6969
- After the last null-check/argument-validation line in a method, add a blank line before the next statement
7070
- If a method has only one null-check/argument-validation line, still add a blank line after that final guard line
7171
- Add a blank line before a `return` statement unless the `return` is the first statement inside a `{ ... }` block
72+
- Never use more than one consecutive blank line
7273
- Add a blank line before and after `if` blocks, `switch` statements, and loops unless the block is immediately preceded by `{`
7374
- Do not add a blank line between an `if`/`else`/`switch`/loop condition and its opening `{`
75+
- Do not add a blank line immediately after `#pragma warning disable` or immediately before `#pragma warning restore`
76+
- Do not add a blank line immediately after `#pragma warning restore` when the next line is `{`
77+
- Add a blank line before a `#pragma warning disable` block when it starts a new member after a closing `}`
78+
- Add a blank line between a `#pragma warning restore` and the next `#pragma warning disable` when they guard separate members
79+
- Format conditional operators across multiple lines with the condition on its own line and the `?` and `:` tokens on their own indented lines
7480
- Use `var` consistently with repository style
7581
- Do not use `global using` files; add explicit `using` directives at the top of each file instead.
7682
- Prefer top-of-file `using` directives over fully qualified type names in code.
7783
- Only use expression-bodied members when the entire member fits on a single short line; use a full block body for anything longer or split across lines
7884
- Avoid `DateTime.UtcNow`; prefer injected `TimeProvider`.
7985
- Keep public docs and comments honest to the current code.
80-
- Always document new interfaces, their methods and arguments along with documenting every property on domain models using `<summary>` block.
86+
- Always document every method, including constructor overloads, with accurate XML `<summary>` and `<param>` blocks for every argument.
87+
- Only add XML `<param>` tags for parameters that actually exist on the documented member, and keep them in the exact same order as the signature.
88+
- Always document publicly accessible properties with accurate XML `<summary>` blocks.
89+
- Always insert a blank line before XML `<summary>` documentation blocks unless they are immediately preceded by `{`.
90+
- Never insert a blank line between an XML documentation block and the member it documents.
91+
- If XML documentation already exists, improve the existing block in place instead of stacking a second `<summary>` block above it.
92+
- Always document new interfaces and all of their members and arguments.
93+
- When a constructor has more than one parameter, span its parameter list across multiple lines.
94+
- Put constructor initializer clauses like `: base(...)` on their own indented line
95+
- Seal publicly accessible classes by default and only leave them unsealed when inheritance is intentionally required.
8196
- Always treat warnings are errors in the solutions and ensure every warning is addressed.
8297
- Always learn from my prompts, preference and styles and update the `copilot-instructions.md` file with any new preferences that I share in the future.
8398
- Prefer SOLID and DRY refactors that consolidate duplicated provider, transport, or store logic into shared abstractions before adding new one-off implementations.
8499
- Favor additive shared infrastructure first, then migrate consumers in behavior-safe steps when a full replacement is too risky for a single change.
85100
- When working in framework code meant for external adoption, optimize for consistency and long-term maintainability across providers and hosts, not just local fixes.
86101
- For optional provider integrations in sample hosts, do not eagerly read validated options in UI setup paths when an unconfigured provider should simply appear unavailable rather than crash the page.
102+
- Always keep exactly one trailing newline at the end of each file, no more and no less.
87103

88104
## Runtime notes
89105

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--- Please make sure that you're familiar with our contribution guidelines before submitting a pull request: https://docs.orchardcore.net/en/latest/guides/contributing/. -->
1+
<!--- Please make sure that you're familiar with our contribution guidelines before submitting a pull request: https://docs.orchardcore.net/en/latest/guides/contributing/. -->

.github/workflows/assets_validation.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ jobs:
4747
Write-Output ''
4848
Write-Output '---------------------------------------'
4949
Write-Output ''
50-
50+
5151
$changeLines = $changes -split '`n'
5252
$changedFiles = @()
5353
$hasNonCrlfChange = $false
54-
54+
5555
foreach ($line in $changeLines)
5656
{
5757
if ($line -match '^\s?(M|A|\?\?)\s+(.*)$')
5858
{
5959
$changeType = $matches[1]
6060
$file = $matches[2]
61-
61+
6262
Write-Output "Diff for: $file"
63-
63+
6464
if ($changeType -eq 'M')
6565
{
6666
# File is modified; use git diff to get the diff of the modified file.
@@ -88,26 +88,26 @@ jobs:
8888
Get-Content -Path $file
8989
$hasNonCrlfChange = $true
9090
}
91-
91+
9292
$changedFiles += $file
93-
93+
9494
Write-Output ''
9595
Write-Output '---------------------------------------'
9696
Write-Output ''
9797
}
9898
}
99-
99+
100100
if (-not $hasNonCrlfChange)
101101
{
102102
Write-Output 'No non-CRLF changes found. Repository is clean.'
103103
exit 0
104104
}
105-
105+
106106
# Convert the array of changed files to a single string with each file on a new line so actions/upload-artifact
107107
# can consume it.
108108
$changedFilesString = $changedFiles -join "`n"
109109
"CHANGED_FILES<<ENDOFSTRING`n$($changedFilesString)`nENDOFSTRING" >> $Env:GITHUB_ENV
110-
110+
111111
exit -1
112112
}
113113
else
@@ -121,4 +121,3 @@ jobs:
121121
name: changed-files
122122
path: ${{ env.CHANGED_FILES }}
123123
retention-days: 30
124-

.github/workflows/backport.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
uses: dotnet/arcade/.github/workflows/backport-base.yml@main
2020
with:
2121
repository_owners: 'CrestApps'
22-
22+
2323
pr_description_template: |
2424
Backport of #%source_pr_number% to %target_branch%
2525
2626
/cc %cc_users%
27-

.github/workflows/codeql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@ jobs:
6161
uses: github/codeql-action/analyze@v3
6262
with:
6363
category: "/language:javascript-typescript"
64-

.github/workflows/copilot-setup-steps.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ jobs:
2424
2525
- name: Restore NuGet packages
2626
run: dotnet restore
27-

.github/workflows/deploy_docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ jobs:
6666
- name: Deploy to GitHub Pages
6767
id: deployment
6868
uses: actions/deploy-pages@v4
69-

.github/workflows/main_ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ jobs:
4141
- name: Unit Tests
4242
run: |
4343
dotnet test -c Release --no-build ./tests/CrestApps.Core.Tests/CrestApps.Core.Tests.csproj
44-

.github/workflows/pr_ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ jobs:
3737
- name: Unit Tests
3838
run: |
3939
dotnet test -c Release --no-build ./tests/CrestApps.Core.Tests/CrestApps.Core.Tests.csproj
40-

0 commit comments

Comments
 (0)