Files
DodoSSH/.editorconfig
T
jaap-jan 3a81f3c90b Restructure into src/tests and add build foundation (M0)
Moves the scaffold to src/DodoSSH.Api and establishes the repo conventions the rest
of the milestones build on.

Structure:
- src/{Contracts,Crypto,Domain,Infrastructure,Api}, tests/{Contracts,Crypto,Domain}.Tests
- DodoSSH.slnx rewritten with src/ and tests/ solution folders

Build:
- Directory.Build.props centralises TFM, nullable, deterministic builds and
  TreatWarningsAsErrors; Directory.Packages.props pins every version centrally
- packages.lock.json committed so CI restores in locked mode
- NuGet.config clears machine-level sources, which both fixes NU1507 under central
  package management and makes restore reproducible off this machine
- Microsoft.OpenApi pinned to 2.11.0: ASP.NET Core 10.0.10 resolves 2.0.0, which is
  covered by GHSA-v5pm-xwqc-g5wc (high, patched in 2.7.5)

Analyzers:
- AnalysisLevel is Recommended, not All. With warnings-as-errors, All turns opinionated
  naming rules into build breaks and trains people to blanket-suppress.
- BannedSymbols.txt bans DateTime.UtcNow (TimeProvider), Guid.NewGuid (CreateVersion7),
  sync-over-async, MD5/SHA1, PBKDF2 and SecureString
- CA1711/CA1724 disabled: both are .NET Framework CAS-era naming rules
- PublicApiAnalyzers on Contracts only, since that assembly is the client's real contract

API:
- weather-forecast template removed
- UseHttpsRedirection removed; TLS terminates at the reverse proxy and redirecting
  behind one causes loops
- /healthz/{live,ready,startup}. Liveness deliberately checks no dependencies so a
  transient database outage cannot restart the container and kill live SSH sessions.

Notes:
- No coverage collector yet. Microsoft.Testing.Extensions.CodeCoverage pulls an MTP 1.x
  MSBuild extension that throws TypeLoadException against the MTP 2.3.x xunit.v3 brings.
  Coverage gates are an M3 concern; revisit with an MTP 2.x-aligned version then.

Verified: dotnet build (0 warnings), 17 tests pass, format check clean, API serves
health and OpenAPI endpoints.
2026-07-28 12:25:34 +02:00

115 lines
4.9 KiB
INI

# EditorConfig for DodoSSH — https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.{json,yml,yaml,js,ts,css,html,axaml,xaml,csproj,props,targets,slnx}]
indent_size = 2
[*.md]
# Two trailing spaces are a hard line break in Markdown.
trim_trailing_whitespace = false
[*.{cmd,bat,ps1}]
end_of_line = crlf
[*.cs]
indent_size = 4
#### Language conventions ####
csharp_style_namespace_declarations = file_scoped:error
csharp_using_directive_placement = outside_namespace:error
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion
csharp_prefer_braces = true:suggestion
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = true:suggestion
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_readonly_field = true:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
# Async methods must be suffixed Async (VSTHRD200 equivalent via naming rules below).
dotnet_naming_rule.async_methods_end_in_async.severity = warning
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_method
dotnet_naming_rule.async_methods_end_in_async.style = ends_with_async
dotnet_naming_symbols.any_async_method.applicable_kinds = method
dotnet_naming_symbols.any_async_method.required_modifiers = async
dotnet_naming_style.ends_with_async.required_suffix = Async
dotnet_naming_style.ends_with_async.capitalization = pascal_case
dotnet_naming_rule.interfaces_start_with_i.severity = warning
dotnet_naming_rule.interfaces_start_with_i.symbols = any_interface
dotnet_naming_rule.interfaces_start_with_i.style = starts_with_i
dotnet_naming_symbols.any_interface.applicable_kinds = interface
dotnet_naming_style.starts_with_i.required_prefix = I
dotnet_naming_style.starts_with_i.capitalization = pascal_case
dotnet_naming_rule.private_fields_are_camel_case.severity = warning
dotnet_naming_rule.private_fields_are_camel_case.symbols = private_field
dotnet_naming_rule.private_fields_are_camel_case.style = camel_case_style
dotnet_naming_symbols.private_field.applicable_kinds = field
dotnet_naming_symbols.private_field.applicable_accessibilities = private
dotnet_naming_style.camel_case_style.capitalization = camel_case
#### Diagnostics ####
# Formatting violations fail the build; `dotnet format --verify-no-changes` gates CI.
dotnet_diagnostic.IDE0055.severity = error
# ConfigureAwait is not meaningful in ASP.NET Core (no SynchronizationContext). It IS
# meaningful in the Avalonia client, which re-enables CA2007 in its own .editorconfig.
dotnet_diagnostic.CA2007.severity = none
# Prefer LoggerMessage source generation over ILogger extension calls — allocation-free
# and gives structured events by construction. Warning, so it is visible but not a wall
# during early development; raised to error once the logging pass lands in M4.
dotnet_diagnostic.CA1848.severity = warning
# Exceptions carry ProblemDetails codes, not localised text.
dotnet_diagnostic.CA1303.severity = none
# CA1711 reserves the suffixes Flags, Permission, Collection, Stream and friends for
# .NET Framework CAS and BCL base types that have no bearing on this codebase. The BCL
# itself ships BindingFlags. PermissionFlags is the clearest name for a [Flags] enum of
# permissions, and contorting domain vocabulary to satisfy a legacy rule costs more than
# it returns.
dotnet_diagnostic.CA1711.severity = none
# CA1724 flags any type whose name collides with a BCL *namespace* (e.g. a type named
# Permissions vs System.Security.Permissions). Namespace-qualified resolution makes this
# a non-issue in practice and it heavily constrains domain naming.
dotnet_diagnostic.CA1724.severity = none
# We use file-scoped namespaces and modern C#; these fire on deliberate style choices.
dotnet_diagnostic.CA1812.severity = none # internal types instantiated by DI
dotnet_diagnostic.CA1849.severity = warning # sync call in async method
[tests/**/*.cs]
# Test classes are instantiated by xunit, and test data is often public static.
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1034.severity = none
[src/DodoSSH.Infrastructure/Migrations/*.cs]
# EF Core generates these; do not lint or format them.
generated_code = true
dotnet_analyzer_diagnostic.severity = none
dotnet_diagnostic.IDE0055.severity = none