The code I wrote in the “step to reproduce” should not be flagged as a violation.
Actual behaviorThe code I wrote in the “step to reproduce” section is flagged by Layout/EmptyLinesAfterModuleInclusion.
When I follow its suggestion and add a blank line after prepend Module.new do
, it then causes a Layout/EmptyLinesAroundBlockBody violation.
rubocop --enable-pending-cops
# frozen_string_literal: true # class C document class C prepend Module.new do def foo puts 'foo' super end end endRuboCop version
1.79.0 (using Parser 3.3.9.0, rubocop-ast 1.46.0, analyzing as Ruby 2.7, running on ruby 3.4.5) [arm64-darwin24]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4