Skip to content

fix(ruby): skip empty Comment nodes to avoid Layout/EmptyComment RuboCop offense in ruby-v2#15854

Merged
iamnamananand996 merged 1 commit into
mainfrom
fix/ruby-v2-empty-comment-rubocop
May 12, 2026
Merged

fix(ruby): skip empty Comment nodes to avoid Layout/EmptyComment RuboCop offense in ruby-v2#15854
iamnamananand996 merged 1 commit into
mainfrom
fix/ruby-v2-empty-comment-rubocop

Conversation

@iamnamananand996
Copy link
Copy Markdown
Contributor

@iamnamananand996 iamnamananand996 commented May 12, 2026

Description

Linear ticket: Closes

Types with no description were emitting a bare # line above their class definition in ruby-v2 generator output, triggering the Layout/EmptyComment RuboCop offense on generated SDKs. The Ruby AST Comment.write path is now guarded so that whitespace-only or empty docs produce no output at all, instead of writing a bare comment marker.

Changes Made

  • generators/ruby-v2/ast/src/ast/Comment.ts: tighten the write guard from this.docs != null to this.docs?.trim() so undocumented model classes no longer emit a leading # line.
  • generators/ruby-v2/sdk/changes/unreleased/fix-empty-comment-rubocop.yml: add a fix changelog entry describing the RuboCop fix.
  • Updated README.md generator (if applicable)

Testing

  • Unit tests added/updated
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/2e4e587dd160400390839880a5434932
Requested by: @iamnamananand996

…fense

Types with no description were emitting a bare `#` line above the class
definition, triggering `Layout/EmptyComment`. Guard the Comment AST node
write path with `.trim()` so whitespace-only or empty docs produce no output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@github-actions
Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-05-12T05:12:12Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
ruby-sdk-v2 square 81s (n=5) 118s (n=5) 80s -1s (-1.2%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-05-12T05:12:12Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-05-12 19:04 UTC

@devin-ai-integration devin-ai-integration Bot changed the title fix(ruby-v2): skip empty comment nodes to prevent bare # RuboCop of… fix(ruby): skip empty Comment nodes to avoid Layout/EmptyComment RuboCop offense in ruby-v2 May 12, 2026
@iamnamananand996 iamnamananand996 merged commit c8f932e into main May 12, 2026
71 of 72 checks passed
@iamnamananand996 iamnamananand996 deleted the fix/ruby-v2-empty-comment-rubocop branch May 12, 2026 19:19
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