Skip to content

Rename fields#1149

Merged
christianhelle merged 8 commits into
mainfrom
house-keeping
Jun 15, 2026
Merged

Rename fields#1149
christianhelle merged 8 commits into
mainfrom
house-keeping

Conversation

@christianhelle

@christianhelle christianhelle commented Jun 15, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a new naming convention for private fields and refactors several core classes to use camelCase field names instead of the previous underscore-prefixed style. It also updates documentation and code style enforcement to match the new convention. Additionally, a product requirements document (PRD) for deepening the InterfaceGenerator module has been removed.

The most important changes are:

Code Style & Naming Conventions:

  • Enforces that private fields must use camelCase without an underscore prefix, both in .editorconfig rules and in documentation (.editorconfig, docs/AGENTS.md). [1] [2] [3] [4]
  • Refactors private fields in ApizrOptionsBuilder, DocumentMerger, and RefitGeneratorSettings (and related config classes) to use camelCase without an underscore prefix, updating all usages accordingly (src/Refitter.Core/ApizrOptionsBuilder.cs, src/Refitter.Core/DocumentMerger.cs, src/Refitter.Core/Settings/RefitGeneratorSettings.cs). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Documentation:

  • Updates AGENTS.md to explicitly state that private fields should not use an underscore prefix and should be camelCase.
  • Removes the product requirements document for deepening the InterfaceGenerator module, indicating the design has either been implemented or is no longer relevant (docs/prd/prd-04-deepen-interface-generator.md).

These changes ensure consistency across the codebase regarding private field naming, improve code readability, and align documentation and style enforcement with current team conventions.

Summary by CodeRabbit

  • Style
    • Updated code-style conventions to require camelCase naming for private/protected instance fields (no leading underscore).
    • Refreshed contributor documentation to reflect the same field-naming guideline.
  • Chores
    • Removed multiple GitHub Actions workflows and automation configuration files.
    • Removed an outdated product requirement document from the docs site.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 450ecd5b-68a7-48f9-9d21-b61cc0252d02

📥 Commits

Reviewing files that changed from the base of the PR and between 3df27f0 and 57a0682.

📒 Files selected for processing (1)
  • .editorconfig

📝 Walkthrough

Walkthrough

Adds an EditorConfig naming rule and an AGENTS.md convention requiring private fields to use camelCase without underscore prefix. Applies this rename across ApizrOptionsBuilder, RefitGeneratorSettings, DocumentMerger, and XmlDocumentationGeneratorTests.

Changes

camelCase private field naming enforcement

Layer / File(s) Summary
Naming rule config and docs
.editorconfig, docs/AGENTS.md
Adds the camelcase_no_prefix EditorConfig naming rule (severity, symbol spec, style) and documents the convention in AGENTS.md.
ApizrOptionsBuilder field renames
src/Refitter.Core/ApizrOptionsBuilder.cs
Renames underscore-prefixed backing fields to camelCase (optionsCode, usingsCode, packages, hasOptions) across the constructor, property accessors, and builder methods, preserving all public APIs and option-building behavior.
RefitGeneratorSettings field renames
src/Refitter.Core/Settings/RefitGeneratorSettings.cs
Renames underscore-prefixed configuration backing fields to camelCase (openApiSource, codeGeneration, parameterConfig, outputConfig, typeConfig, filterConfig, schemaConfig, featureConfig) and updates all public property accessors to delegate through the renamed backing fields.
DocumentMerger field rename
src/Refitter.Core/DocumentMerger.cs
Renames _comparer to comparer in the constructor initialization and the merge collision equivalence check call site.
XmlDocumentationGeneratorTests field rename
src/Refitter.Tests/XmlDocumentationGeneratorTests.cs
Renames the private backing field from _generator to generator and updates all test method call sites to use the renamed field.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • christianhelle/refitter#1148: Refactored RefitGeneratorSettings to delegate properties to internal config-record backing fields — directly the same class and private-field wiring pattern modified in this PR.
  • christianhelle/refitter#1114: Includes overlapping private backing-field underscore-to-non-underscore renames across RefitGeneratorSettings and related settings fields.

Poem

🐇 No more underscores in sight,
camelCase makes private fields bright!
Cleaner code, what a delight,
Each field renamed—convention's right. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Rename private fields' is directly related to the main changeset, which systematically renames private instance fields across multiple source files from underscore-prefixed to camelCase naming convention.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch house-keeping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.editorconfig:
- Around line 309-312: Remove the duplicate definition of the private_fields
naming symbol specification in the .editorconfig file. The symbol specification
for private_fields (including
dotnet_naming_symbols.private_fields.applicable_kinds,
dotnet_naming_symbols.private_fields.applicable_accessibilities, and
dotnet_naming_symbols.private_fields.required_modifiers) is defined twice, with
the duplicate appearing after an earlier definition. Delete the second duplicate
occurrence of this entire private_fields symbol specification block to avoid
maintenance confusion and since EditorConfig uses the last definition.

In `@src/Refitter.Core/DocumentMerger.cs`:
- Around line 16-19: The DocumentMerger constructor has a self-assignment bug
where the parameter `comparer` is being assigned to itself instead of to the
instance field. Fix this by using the `this` keyword to explicitly assign the
constructor parameter to the instance field, changing the assignment from
`comparer = comparer;` to `this.comparer = comparer;`. This will ensure the
instance field is properly initialized so that subsequent calls to
`MergeIfMissingOrConflict` can safely use the comparer without encountering a
NullReferenceException.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f1c52503-5f84-4705-a8d2-d83c138bf7f0

📥 Commits

Reviewing files that changed from the base of the PR and between abc0300 and 8c80dfa.

📒 Files selected for processing (7)
  • .editorconfig
  • docs/AGENTS.md
  • docs/prd/prd-04-deepen-interface-generator.md
  • src/Refitter.Core/ApizrOptionsBuilder.cs
  • src/Refitter.Core/DocumentMerger.cs
  • src/Refitter.Core/Settings/RefitGeneratorSettings.cs
  • src/Refitter.Tests/XmlDocumentationGeneratorTests.cs
💤 Files with no reviewable changes (1)
  • docs/prd/prd-04-deepen-interface-generator.md

Comment thread .editorconfig Outdated
Comment thread src/Refitter.Core/DocumentMerger.cs
@christianhelle christianhelle changed the title refactor: remove underscore prefix from private fields Rename private fields Jun 15, 2026
@christianhelle christianhelle self-assigned this Jun 15, 2026
@christianhelle christianhelle added enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code labels Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.54%. Comparing base (4cf407b) to head (57a0682).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1149   +/-   ##
=======================================
  Coverage   94.54%   94.54%           
=======================================
  Files          67       67           
  Lines        3100     3100           
=======================================
  Hits         2931     2931           
  Misses         59       59           
  Partials      110      110           
Flag Coverage Δ
unittests 94.54% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@christianhelle
christianhelle enabled auto-merge June 15, 2026 11:05
@christianhelle
christianhelle merged commit 1ab323d into main Jun 15, 2026
7 of 8 checks passed
@christianhelle
christianhelle deleted the house-keeping branch June 15, 2026 11:07
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant