-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Closed
Copy link
Labels
Description
Expected behavior
No offense for this example
def foo(params)
return true if <<-TEXT.length > 100
bar #{params[:baz]}
TEXT
false
end
Actual behavior
Getting Layout/EmptyLineAfterGuardClause
┗ rubocop asdf.rb --debug
For /Users/alter: Default configuration from /Users/alter/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.50.1/config/default.yml
Use parallel by default.
Skipping parallel inspection: only a single file needs inspection
Inspecting 1 file
Scanning /Users/alter/asdf.rb
C
Offenses:
asdf.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
def foo(params)
^
asdf.rb:2:3: C: [Correctable] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return true if <<-TEXT.length > 100
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 2 offenses detected, 2 offenses autocorrectable
Finished in 0.15189099998679012 seconds
RuboCop version
┗ rubocop -V
1.50.1 (using Parser 3.2.2.0, rubocop-ast 1.28.0, running on ruby 3.1.2) [x86_64-darwin21]