fix(ruby): skip empty Comment nodes to avoid Layout/EmptyComment RuboCop offense in ruby-v2#15854
Conversation
…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>
There was a problem hiding this comment.
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.
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
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 |
# RuboCop of…Layout/EmptyComment RuboCop offense in ruby-v2
Description
Linear ticket: Closes
Types with no description were emitting a bare
#line above their class definition inruby-v2generator output, triggering theLayout/EmptyCommentRuboCop offense on generated SDKs. The Ruby ASTComment.writepath 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 fromthis.docs != nulltothis.docs?.trim()so undocumented model classes no longer emit a leading#line.generators/ruby-v2/sdk/changes/unreleased/fix-empty-comment-rubocop.yml: add afixchangelog entry describing the RuboCop fix.Testing
Link to Devin session: https://app.devin.ai/sessions/2e4e587dd160400390839880a5434932
Requested by: @iamnamananand996