-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
File.open('a', 'w') { }
Expected behavior
Describe here how you expected RuboCop to behave in this particular situation.
idk. I decided to use AllowBracesOnProceduralOneLiners
also.
Actual behavior
Describe here what actually happened.
Please use rubocop --debug
when pasting rubocop output as it contains additional information.
$ ./rubocop -a t.rb
t.rb:1:21: F: Lint/Syntax: unexpected token tIDENTIFIER
(Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
File.open('a', 'w') doend
^^^^^
t.rb:1:21: C: [Corrected] Style/BlockDelimiters: Prefer do...end over {...} for procedural blocks.
File.open('a', 'w') { }
^
t.rb:1:22: C: [Corrected] Layout/SpaceInsideBlockBraces: Space inside empty braces detected.
File.open('a', 'w') { }
^
1/1 file |======================= 100 =======================>| Time: 00:00:01
1 file inspected, 3 offenses detected, 2 offenses corrected
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
RuboCop version
Include the output of rubocop -V
or bundle exec rubocop -V
if using Bundler.
If you see extension cop versions (e.g. rubocop-performance
, rubocop-rspec
, and others)
output by rubocop -V
, include them as well. Here's an example:
$ [bundle exec] rubocop -V
1.67.0 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux]
- rubocop-performance 1.22.1
- rubocop-rspec 3.1.0