Skip to content

Conversation

@iamnamananand996
Copy link
Member

@iamnamananand996 iamnamananand996 commented Jan 6, 2026

Description

Adds a configurable rubocopVariableNumberStyle option to control RuboCop's Naming/VariableNumber style in generated Ruby SDKs. This allows APIs with field names containing embedded digits (e.g., recaptcha_v2, office365, thumbprint_sha256) to configure the appropriate style.

Link to Devin run: https://app.devin.ai/sessions/3d112cd502b04c18bc02bf2511fad7d2
Requested by: @iamnamananand996

Changes Made

  • Added rubocopVariableNumberStyle config option to BaseRubyCustomConfigSchema with three values:
    • snake_case (default): requires underscores before numbers (e.g., recaptcha_v_2)
    • normalcase: allows numbers without underscores (e.g., recaptcha_v2, office365)
    • disabled: disables the cop entirely
  • Updated RubocopFile.ts to read from config and generate appropriate .rubocop.yml content
  • Added changelog entry for version 1.0.0-rc77
  • Updated README.md generator (if applicable) - N/A

Usage

For APIs like auth0 with field names containing embedded digits, add to generators.yml:

ruby-sdk:
  rubocopVariableNumberStyle: normalcase

Implementation Notes

  • Uses inline z.enum() directly in the schema field, matching the existing pattern used by other config schemas (TypeScript, Python, Go, Java, PHP)
  • No separate type export needed - TypeScript infers the type from the schema

Testing

  • Manual testing completed - Lint checks pass (pnpm run check)
  • TypeScript compilation verified locally (tsc --build)
  • Unit tests added/updated - N/A (config change only)

Human Review Checklist

  • Verify the three config values (snake_case, normalcase, disabled) generate correct .rubocop.yml output
  • Confirm default (snake_case) maintains backward compatibility for existing SDKs
  • Verify inline z.enum() pattern matches other config schemas in the codebase

The generated .rubocop.yml was using 'snake_case' style which requires
underscores before numbers (e.g., 'recaptcha_v_2'). Changed to 'normalcase'
style to allow field names like 'recaptcha_v2', 'office365', 'thumbprint_sha256',
etc. without triggering lint errors.

This matches the SDK's naming convention where lodash snakeCase produces
names like 'recaptcha_v2' (not 'recaptcha_v_2').

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Add configurable RuboCop Naming/VariableNumber style with three options:
- snake_case (default): requires underscores before numbers (e.g., recaptcha_v_2)
- normalcase: allows numbers without underscores (e.g., recaptcha_v2, office365)
- disabled: disables the cop entirely

This allows APIs with field names containing embedded digits to configure
the appropriate style in their generators.yml.

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title fix(ruby): change RuboCop Naming/VariableNumber style to normalcase feat(ruby): add rubocopVariableNumberStyle config option Jan 6, 2026
devin-ai-integration bot and others added 2 commits January 6, 2026 21:30
Fix TypeScript TS1205 error: Re-exporting a type when 'isolatedModules'
is enabled requires using 'export type'.

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
Match existing pattern in other config schemas by inlining z.enum
directly in the schema field instead of exporting separate schema
constant and type. TypeScript infers the type from the schema.

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants