Skip to content

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Oct 1, 2025

Summary by CodeRabbit

  • Bug Fixes

    • .NET identifiers (types, properties, enums) consistently use PascalCase to match .NET naming conventions.
    • Model property and constructor parameter types now render as raw type expressions to prevent formatting issues.
  • Refactor

    • Name construction consolidated to a single PascalCase approach for consistent generated output without changing public APIs.

Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Walkthrough

The DotNet language generator now uses toPascalCase for constructing public-facing identifiers, replacing previous ucfirst usage for types, property names, and enum names, including handling for array sub-schemas. Property name generation applies toPascalCase then strips leading '$' characters. Keyword comparisons now use PascalCased names. In the .NET model template, property types and constructor parameter types are rendered with the raw filter. These changes adjust identifier casing and how type expressions are emitted in generated models.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title indicates a fix related to .NET templates but is overly generic and does not clearly summarize the specific changes to naming conventions and template rendering introduced in the pull request. Please rename the title to reference the specific fixes, for example by mentioning the switch to PascalCase naming and use of raw type rendering in .NET templates to improve clarity.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-dotnet-issues

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e736b7 and 112022a.

📒 Files selected for processing (1)
  • src/SDK/Language/DotNet.php (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/SDK/Language/DotNet.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build (8.3, WebChromium)
  • GitHub Check: build (8.3, Ruby31)
  • GitHub Check: build (8.3, WebNode)
  • GitHub Check: build (8.3, Swift56)
  • GitHub Check: build (8.3, AppleSwift56)
  • GitHub Check: build (8.3, Python312)
  • GitHub Check: build (8.3, FlutterStable)
  • GitHub Check: build (8.3, CLINode16)
  • GitHub Check: build (8.3, Android14Java17)
  • GitHub Check: build (8.3, Android5Java17)

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/SDK/Language/DotNet.php (1)

498-506: Trim only leading '$' with ltrim
Replace str_replace('$', '', $name) with ltrim($name, '$') to preserve any internal '$' characters and future-proof property naming.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07a7d62 and 3e736b7.

📒 Files selected for processing (2)
  • src/SDK/Language/DotNet.php (2 hunks)
  • templates/dotnet/Package/Models/Model.cs.twig (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/SDK/Language/DotNet.php (1)
src/SDK/Language.php (1)
  • toPascalCase (96-99)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: build (8.3, AppleSwift56)
  • GitHub Check: build (8.3, Ruby31)
  • GitHub Check: build (8.3, Swift56)
  • GitHub Check: build (8.3, Python312)
  • GitHub Check: build (8.3, Ruby30)
  • GitHub Check: build (8.3, Python311)
  • GitHub Check: build (8.3, Ruby27)
  • GitHub Check: build (8.3, Python39)
  • GitHub Check: build (8.3, Python310)
  • GitHub Check: build (8.3, Python313)
  • GitHub Check: build (8.3, KotlinJava17)
  • GitHub Check: build (8.3, KotlinJava8)
  • GitHub Check: build (8.3, KotlinJava11)
  • GitHub Check: build (8.3, Go118)
  • GitHub Check: build (8.3, FlutterStable)
  • GitHub Check: build (8.3, CLINode18)
  • GitHub Check: build (8.3, Android14Java17)
  • GitHub Check: build (8.3, Android5Java17)
🔇 Additional comments (3)
templates/dotnet/Package/Models/Model.cs.twig (2)

24-24: Consistent with property type rendering.

The raw filter is correctly applied to constructor parameter types, matching the approach used for property declarations at line 15.


15-15: Verify necessity and safety of raw filter

Raw bypasses Twig auto-escaping so generic types (e.g., List<SubSchema>) render correctly; confirm sub_schema() only emits trusted, internally-generated type names to avoid injection risk.

src/SDK/Language/DotNet.php (1)

481-481: Breaking change: .NET array sub-schema types now use full PascalCase.
This replaces ucfirst with toPascalCase, altering generated type names (e.g., user_settingsUserSettings). Confirm this is intentional and ensure existing SDK consumers are updated for the renamed types.

@ChiragAgg5k ChiragAgg5k merged commit e1ca749 into master Oct 1, 2025
37 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix-dotnet-issues branch October 1, 2025 06:25
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.

2 participants