From 35671e206c351915339e65334110eafdb0a2cb44 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 11 Jun 2023 16:43:04 +0200 Subject: [PATCH] Bump rubocop and rubocop-rails --- .rubocop.yml | 4 +++ Gemfile | 4 +-- Gemfile.lock | 33 ++++++++++--------- Rakefile | 2 +- .../discovery/web_finger_spec.rb | 2 +- spec/spec_helper.rb | 2 +- spec/support/helper_methods.rb | 2 +- test/dummy/config/environments/production.rb | 2 +- 8 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3440ccd..e336e0c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -191,6 +191,10 @@ Rails/NegateInclude: Rails/RakeEnvironment: Enabled: false +# only available on rails >= 6.0 +Rails/IndexWith: + Enabled: false + Lint/ConstantDefinitionInBlock: Exclude: - "spec/**/*" diff --git a/Gemfile b/Gemfile index b9077eb..0fb7255 100644 --- a/Gemfile +++ b/Gemfile @@ -21,8 +21,8 @@ group :development do # code style gem "pronto", "0.11.0", require: false gem "pronto-rubocop", "0.11.2", require: false - gem "rubocop", "1.32.0", require: false - gem "rubocop-rails", "2.15.2", require: false + gem "rubocop", "1.52.0", require: false + gem "rubocop-rails", "2.19.1", require: false gem "rubocop-rake", "0.6.0", require: false # debugging diff --git a/Gemfile.lock b/Gemfile.lock index 3bc0098..f657283 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,7 +72,7 @@ GEM multi_xml (>= 0.5.2) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.2) + json (2.6.3) json-schema (3.0.0) addressable (>= 2.8) listen (3.7.1) @@ -98,9 +98,10 @@ GEM octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) + racc pronto (0.11.0) gitlab (~> 4.4, >= 4.4.0) httparty (>= 0.13.7) @@ -141,7 +142,7 @@ GEM rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.5.0) + regexp_parser (2.8.1) rexml (3.2.5) rspec (3.11.0) rspec-core (~> 3.11.0) @@ -167,25 +168,25 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.11.0) - rubocop (1.32.0) + rubocop (1.52.0) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.19.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.19.1) - parser (>= 3.1.1.0) - rubocop-rails (2.15.2) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) + rubocop (>= 1.33.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rugged (1.0.1) sawyer (0.9.2) @@ -207,7 +208,7 @@ GEM ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.2.0) + unicode-display_width (2.4.2) uuid (2.3.9) macaddr (~> 1.0) valid (1.2.0) @@ -241,8 +242,8 @@ DEPENDENCIES rspec-collection_matchers (~> 1.2.0) rspec-json_expectations (~> 2.1) rspec-rails (~> 5.1.2) - rubocop (= 1.32.0) - rubocop-rails (= 2.15.2) + rubocop (= 1.52.0) + rubocop-rails (= 2.19.1) rubocop-rake (= 0.6.0) simplecov (= 0.21.2) simplecov-rcov (= 0.3.1) diff --git a/Rakefile b/Rakefile index 882b89f..ec95592 100644 --- a/Rakefile +++ b/Rakefile @@ -15,7 +15,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include("lib/**/*.rb") end -if defined?(::Rails) +if defined?(Rails) APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) load "rails/tasks/engine.rake" load "rails/tasks/statistics.rake" diff --git a/spec/lib/diaspora_federation/discovery/web_finger_spec.rb b/spec/lib/diaspora_federation/discovery/web_finger_spec.rb index 52dc4bd..36f7e46 100644 --- a/spec/lib/diaspora_federation/discovery/web_finger_spec.rb +++ b/spec/lib/diaspora_federation/discovery/web_finger_spec.rb @@ -344,7 +344,7 @@ module DiasporaFederation }, { "rel": "self", - "type": "application/ld+json; profile=\\\"https://www.w3.org/ns/activitystreams\\\"", + "type": "application/ld+json; profile=\\"https://www.w3.org/ns/activitystreams\\"", "href": "#{person.url}channel/#{person.nickname}" }, { diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index be04393..8efec0f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -50,7 +50,7 @@ RSpec.configure do |config| expect_config.syntax = :expect end - if defined?(::Rails) + if defined?(Rails) config.before(:each, type: :controller) do ActionController::Base.allow_forgery_protection = true end diff --git a/spec/support/helper_methods.rb b/spec/support/helper_methods.rb index ee413a2..89ec861 100644 --- a/spec/support/helper_methods.rb +++ b/spec/support/helper_methods.rb @@ -34,7 +34,7 @@ def change_time(time, options={}) new_min = options.fetch(:min, options[:hour] ? 0 : time.min) new_sec = options.fetch(:sec, options[:hour] || options[:min] ? 0 : time.sec) - ::Time.utc(time.year, time.month, time.day, new_hour, new_min, new_sec) + Time.utc(time.year, time.month, time.day, new_hour, new_min, new_sec) end # indent helper diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb index 602df3e..5d803d7 100644 --- a/test/dummy/config/environments/production.rb +++ b/test/dummy/config/environments/production.rb @@ -58,7 +58,7 @@ Rails.application.configure do config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new + config.log_formatter = Logger::Formatter.new # Use a different logger for distributed setups. # require "syslog/logger"