Defect #34165

RuboCop warns Layout/SpaceInsideBlockBraces and Layout/SpaceInsideHashLiteralBraces due to r20189 and r20190

Added by Go MAEDA about 1 month ago. Updated 4 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Code cleanup/refactoring
Target version:-
Resolution:Invalid Affected version:

Description

RuboCops displays huge numbers of warnings in the latest trunk.

This is because someone changed .ruboco.yml by committing r20189 and r20190. Those can be disabled again by reverting the two commits.

bundle exec rubocop --regenerate-todo
bundle exec rubocop
Offenses:

app/controllers/activities_controller.rb:62:22: C: Layout/SpaceInsideBlockBraces: Space inside { detected.
        format.html { ...

app/controllers/activities_controller.rb:64:50: C: Layout/SpaceInsideBlockBraces: Space inside } detected.
          render :layout => false if request.xhr? ...

.
.
.

test/unit/user_import_test.rb:126:50: C: Layout/SpaceInsideBlockBraces: Space inside { detected.
    first, second, third = new_records(User, 3) { import.run }
                                                 ^
test/unit/user_import_test.rb:126:61: C: Layout/SpaceInsideBlockBraces: Space inside } detected.
    first, second, third = new_records(User, 3) { import.run }
                                                            ^

902 files inspected, 1092 offenses detected, 1092 offenses auto-correctable

Associated revisions

Revision 20488
Added by Toshi MARUYAMA 4 days ago

add Layout/SpaceInsideBlockBraces excluding files to .rubocop.yml (#34165)

Revision 20489
Added by Toshi MARUYAMA 4 days ago

add Style/BlockDelimiters excluding files to .rubocop.yml (#34165)

History

#1 Updated by Marius BALTEANU about 1 month ago

  • Assignee set to Toshi MARUYAMA

Toshi, how do you want to proceed on this? I agree with Go Maeda, there are too many warnings in the current trunk and for sure we won't touch all those files in order to fix them.

Rubocop log output: https://gitlab.com/redmine-org/redmine/-/jobs/812990254

#3 Updated by Toshi MARUYAMA about 1 month ago

  • Assignee deleted (Toshi MARUYAMA)

https://github.com/marutosi/redmine/commit/38b487827ca5e3101b09d3e332aa086470a2b4fd

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -92,9 +92,9 @@ group :test do
   gem 'capybara', '~> 3.31.0'
   gem "selenium-webdriver" 
   # RuboCop
-  gem 'rubocop', '~> 1.0.0'
-  gem 'rubocop-performance', '~> 1.8.0'
-  gem 'rubocop-rails', '~> 2.8.0'
+  gem 'rubocop', '~> 0.89.0'
+  gem 'rubocop-performance', '~> 1.5.0'
+  gem 'rubocop-rails', '~> 2.5.0'
 end

 local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")

#4 Updated by Toshi MARUYAMA about 1 month ago

  • Subject changed from RuboCop warns Layout/SpaceInsideBlockBraces and Layout/SpaceInsideHashLiteralBraces due to r20189 and r20190 to Down grade rubocop to 0.89.0
  • Assignee set to Go MAEDA

#5 Updated by Toshi MARUYAMA about 1 month ago

  • Subject changed from Down grade rubocop to 0.89.0 to Down grade rubocop to 0.89

#6 Updated by Go MAEDA about 1 month ago

  • Subject changed from Down grade rubocop to 0.89 to RuboCop warns Layout/SpaceInsideBlockBraces and Layout/SpaceInsideHashLiteralBraces due to r20189 and r20190
  • Assignee changed from Go MAEDA to Jean-Philippe Lang

#7 Updated by Toshi MARUYAMA 4 days ago

  • Status changed from New to Closed
  • Assignee deleted (Jean-Philippe Lang)
  • Resolution set to Invalid

Also available in: Atom PDF