[
https://issues.apache.org/jira/browse/THRIFT-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dmytro Shteflyuk updated THRIFT-5940:
-------------------------------------
Issue Type: Improvement (was: New Feature)
> Ruby generator should emit RuboCop-compliant code and SCA should lint
> generated Ruby
> ------------------------------------------------------------------------------------
>
> Key: THRIFT-5940
> URL: https://issues.apache.org/jira/browse/THRIFT-5940
> Project: Thrift
> Issue Type: Improvement
> Components: Ruby - Compiler
> Reporter: Dmytro Shteflyuk
> Assignee: Dmytro Shteflyuk
> Priority: Major
>
> h3. Problem
> The Ruby SCA workflow currently runs RuboCop without regenerating Ruby output
> first, so CI does not reliably lint freshly generated {{{}gen-rb{}}}} files.
> As a result, changes in the Ruby generator can introduce RuboCop violations
> without the RuboCop job in {{.github/workflows/sca.yml}} catching them.
> h3. Reproduction
> # Rebuild {{compiler/cpp}}
> # Regenerate Ruby output for {{{}test/rb{}}}, {{{}tutorial/rb{}}}, and
> {{lib/rb}}
> # Run RuboCop with the repository configuration
> After regeneration, RuboCop inspected more files and reported offenses in
> generated Ruby output.
> h3. Actual Result
> Generated Ruby code can violate the current RuboCop rules, and the existing
> SCA workflow does not always catch that because it does not first regenerate
> the Ruby artifacts that should be linted.
> Observed generator issues included:
> * extra blank lines around top-level generated blocks
> * {{message=nil}} instead of {{message = nil}}
> * trailing whitespace in generated service inheritance lines
> * enum constant rendering with incorrect indentation
> * blank RDoc lines emitted as {{# }} instead of {{#}}
> h3. Expected Result
> Generated Ruby code should be RuboCop-compliant as emitted by the generator
> itself, and the SCA workflow should lint freshly generated Ruby output rather
> than stale checked-in artifacts alone.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)