diff --git a/.editorconfig b/.editorconfig index cbd7fed..e120000 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,7 +23,29 @@ trim_trailing_whitespace = false [*.cs] # --- Naming ------------------------------------------------------------ -# Private fields are camelCase with no underscore prefix. +# Naming rules only surface in the IDE unless IDE1006 itself has a severity. +dotnet_diagnostic.IDE1006.severity = warning + +# Private constants — including static readonly, constants in spirit — are PascalCase. +dotnet_naming_rule.private_constants_are_pascal_case.severity = warning +dotnet_naming_rule.private_constants_are_pascal_case.symbols = private_constants +dotnet_naming_rule.private_constants_are_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.private_constants.applicable_kinds = field +dotnet_naming_symbols.private_constants.applicable_accessibilities = private +dotnet_naming_symbols.private_constants.required_modifiers = const + +dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.severity = warning +dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_are_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# All other private fields are camelCase with no underscore prefix. dotnet_naming_rule.private_fields_are_camel_case.severity = warning dotnet_naming_rule.private_fields_are_camel_case.symbols = private_fields dotnet_naming_rule.private_fields_are_camel_case.style = camel_case_style diff --git a/.gitignore b/.gitignore index 9d3727a..eb8c03b 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,9 @@ CodeCoverage/ TestResult.xml nunit-*.xml +# JetBrains Rider +.idea/ + # Zitadel dev PATs written by the AppHost bind mount .zitadel/ diff --git a/CLAUDE.md b/CLAUDE.md index 99221dd..37cb8a4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -105,7 +105,8 @@ restart the AppHost. - UTC instants end in `Utc` (`CreatedAtUtc`). Identifiers are spelled out — no abbreviations. -- Private fields are camelCase without an underscore prefix. +- Private fields are camelCase without an underscore prefix; private + constants and static readonly fields are PascalCase. - No nested local functions — write a normal method. Don't reach for local functions; extract a private method instead. A one-liner local function can occasionally be acceptable, but that's an edge case, not something to aim diff --git a/docs/technical-requirements.md b/docs/technical-requirements.md index 2794089..307b987 100644 --- a/docs/technical-requirements.md +++ b/docs/technical-requirements.md @@ -304,7 +304,8 @@ manipulates state itself (seeding through EF, reflection as a last resort). - **Naming:** UTC instants end in `Utc` (`CreatedAtUtc`); identifiers are spelled out in full — no abbreviations; private fields are camelCase without - an underscore prefix. + an underscore prefix, while private constants and static readonly fields are + PascalCase. - **No nested local functions — write a normal method.** Don't reach for local functions; extract a private method instead. A one-liner local function can occasionally be acceptable, but that's an edge case, not diff --git a/src/ProductReviews.Domain/ProductReviews.Domain.csproj b/src/ProductReviews.Domain/ProductReviews.Domain.csproj index 9b3fbe9..ec7702e 100644 --- a/src/ProductReviews.Domain/ProductReviews.Domain.csproj +++ b/src/ProductReviews.Domain/ProductReviews.Domain.csproj @@ -5,6 +5,7 @@ + all runtime; build; native; contentfiles; analyzers