Skip to content

Fix IDE1006 naming on private constants and the EF Relational MSB3277 warning#5

Merged
KaliCZ merged 1 commit into
mainfrom
fix/naming-rule-private-constants
Jul 16, 2026
Merged

Fix IDE1006 naming on private constants and the EF Relational MSB3277 warning#5
KaliCZ merged 1 commit into
mainfrom
fix/naming-rule-private-constants

Conversation

@KaliCZ

@KaliCZ KaliCZ commented Jul 16, 2026

Copy link
Copy Markdown
Owner

The IDE flagged IDE1006 on every private constant (for example ZitadelProvisioning.ApplicationName): the naming rule swept all private fields into camelCase, while the code follows the standard C# convention of PascalCase constants. The rule was wrong, not the code.

Changes

  • .editorconfig: private const and private static readonly fields are PascalCase (they are constants in spirit — TimeSpan cannot be const); all other private fields stay camelCase with no underscore. Also set dotnet_diagnostic.IDE1006.severity = warning — per-rule severities only surface in the IDE, so until now naming violations could never fail CI. With TreatWarningsAsErrors they now break the build.
  • EF Relational pin: building with the solution open also surfaced MSB3277 in ProductReviews.Domain.TestsEFCore.Design (PrivateAssets=all) lifted Relational to 10.0.10 inside Domain, but tests resolved the Npgsql provider transitive 10.0.4. Added Microsoft.EntityFrameworkCore.Relational to the existing explicit-floor item group in the Domain csproj so the pin flows to every consumer. (MSBuild warnings are not covered by TreatWarningsAsErrors, which is why CI never saw it.)
  • Docs: CLAUDE.md + technical-requirements.md naming sections updated with the constants carve-out.
  • .gitignore: added .idea/.

Verification

dotnet build ProductReviews.slnx with the new enforcement: 0 warnings, 0 errors — so no naming violation survives anywhere in the solution. Domain tests: 13/13 passed.

🤖 Generated with Claude Code

Private const and static readonly fields are PascalCase by convention,
but the naming rule swept all private fields into camelCase and lit up
IDE1006 across the codebase. Carve them out, and give IDE1006 itself a
severity so naming violations fail the build instead of living only in
the IDE.

Also pin Microsoft.EntityFrameworkCore.Relational in the Domain floor:
EFCore.Design lifted it to 10.0.10 privately, so Domain.Tests resolved
the Npgsql provider transitive 10.0.4 and warned MSB3277 on every build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@KaliCZ
KaliCZ merged commit 8cb0887 into main Jul 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant