From a9bb673881aaac06e739982d9d3b32438327efdf Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 16 Sep 2017 04:52:18 +0200 Subject: [PATCH] Bump rubocop --- .rubocop.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 8 ++++---- .../notification_mailers/mentioned_in_comment.rb | 2 +- app/mailers/notification_mailers/started_sharing.rb | 2 +- lib/tasks/generate_session_secret.rake | 12 +++++------- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 896e50f7a..02fd23ffd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -153,7 +153,7 @@ Style/Documentation: Enabled: false # This is just silly. Calling the argument `other` in all cases makes no sense. -Style/OpMethod: +Naming/BinaryOperatorParameterName: Enabled: false # There are valid cases, for example debugging Cucumber steps, diff --git a/Gemfile b/Gemfile index 64b14656a..8b8166f63 100644 --- a/Gemfile +++ b/Gemfile @@ -251,7 +251,7 @@ group :development do gem "pronto-haml", "0.9.0", require: false gem "pronto-rubocop", "0.9.0", require: false gem "pronto-scss", "0.9.1", require: false - gem "rubocop", "0.49.1", require: false + gem "rubocop", "0.50.0", require: false # Preloading environment diff --git a/Gemfile.lock b/Gemfile.lock index 07e3c33ff..54cf50389 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -607,15 +607,15 @@ GEM rspec-mocks (~> 3.6.0) rspec-support (~> 3.6.0) rspec-support (3.6.0) - rubocop (0.49.1) + rubocop (0.50.0) parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-oembed (0.12.0) - ruby-progressbar (1.8.1) + ruby-progressbar (1.8.3) ruby_dep (1.5.0) rubyzip (1.2.1) rufus-scheduler (3.4.2) @@ -874,7 +874,7 @@ DEPENDENCIES responders (= 2.4.0) rspec-json_expectations (~> 2.1) rspec-rails (= 3.6.1) - rubocop (= 0.49.1) + rubocop (= 0.50.0) ruby-oembed (= 0.12.0) rubyzip (= 1.2.1) sass-rails (= 5.0.6) diff --git a/app/mailers/notification_mailers/mentioned_in_comment.rb b/app/mailers/notification_mailers/mentioned_in_comment.rb index cdfa74fa1..056226ffd 100644 --- a/app/mailers/notification_mailers/mentioned_in_comment.rb +++ b/app/mailers/notification_mailers/mentioned_in_comment.rb @@ -4,7 +4,7 @@ module NotificationMailers class MentionedInComment < NotificationMailers::Base attr_reader :comment - def set_headers(target_id) # rubocop:disable Style/AccessorMethodName + def set_headers(target_id) # rubocop:disable Naming/AccessorMethodName @comment = Mention.find_by_id(target_id).mentions_container @headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>" diff --git a/app/mailers/notification_mailers/started_sharing.rb b/app/mailers/notification_mailers/started_sharing.rb index d3d9db164..c66749c9c 100644 --- a/app/mailers/notification_mailers/started_sharing.rb +++ b/app/mailers/notification_mailers/started_sharing.rb @@ -2,7 +2,7 @@ module NotificationMailers class StartedSharing < NotificationMailers::Base - def set_headers(*_args) # rubocop:disable Style/AccessorMethodName + def set_headers(*_args) # rubocop:disable Naming/AccessorMethodName @headers[:subject] = I18n.t("notifier.started_sharing.subject", name: @sender.name) end end diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake index 01e6c2944..28af3ef6e 100644 --- a/lib/tasks/generate_session_secret.rake +++ b/lib/tasks/generate_session_secret.rake @@ -3,11 +3,10 @@ namespace :generate do desc 'Generates a Session Secret Token' task :secret_token do - - path = Rails.root.join('config', 'initializers', 'secret_token.rb') - secret = SecureRandom.hex(40) - File.open(path, 'w') do |f| - f.write <<"EOF" + path = Rails.root.join("config", "initializers", "secret_token.rb") + secret = SecureRandom.hex(40) + File.open(path, "w") do |f| + f.write <