Codify camelCase private-field naming (no s_ prefix) in .editorconfig#459
Merged
ChrisonSimtian merged 1 commit intoJul 2, 2026
Conversation
Collaborator
Author
|
@dennisdoomen I think its time to tighten this up a bit more, what do you think? |
dennisdoomen
approved these changes
Jul 1, 2026
dennisdoomen
left a comment
Collaborator
There was a problem hiding this comment.
This is normally caught by SA1309, but we have not enabled the Roslyn analyzers. So yes, this should be there as well.
Codify CSharpGuidelines AV1702 (camelCase private fields) and AV1705 (no `_`/`m_`/`g_`/`s_` field prefixes) as a dotnet_naming_rule. Ordered after the existing constant-fields rule so private const still resolves to PascalCase. Severity is suggestion for now — the repo still carries ~100 `s_`-prefixed static fields. Promoting to warning/error is gated on a one-time migration sweep, which is the coordination this PR is tracking. Draft until we agree the target severity and sequence the rename. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
106556d to
dc46302
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
No enforced repo standard for private field naming. Fields are split between the dotnet/runtime
s_camelCasestyle (~100 occurrences, 39 files) and ad-hocPascalCase..editorconfigonly governsconstfields today.What this does
Adds a
dotnet_naming_rulecodifying CSharpGuidelines AV1702 (camelCase private fields) + AV1705 (no_/m_/g_/s_prefixes). Ordered after the existing constant-fields rule soprivate conststill resolves to PascalCase.Why draft — this is a coordinated workstream
Severity is
suggestiondeliberately. The ~100 existings_fields mean awarning/errorflip fails the build until they're renamed. Open questions to settle before this leaves draft:suggestion→warning→error?)PascalCasestatic-readonly cases (e.g.KnownWords, regexPatternfields) are in scope for the renameAV1708(Manager/Utility/Helperin type names, e.g.BuildManager) is folded in or tracked separatelyThe localized
s_cancellationHandlers→cancellationHandlersrename already landed on #450 as manual cleanup; this PR is the repo-wide follow-up.🤖 Generated with Claude Code