diff --git a/Gemfile b/Gemfile index 9e7ee81f6..dda3e6d4c 100644 --- a/Gemfile +++ b/Gemfile @@ -106,7 +106,7 @@ group :development do gem "pronto-eslint", "~> 0.11.1", require: false gem "pronto-rubocop", "~> 0.11.5", require: false gem "pronto-scss", "~> 0.11.0", require: false - gem "rubocop", "~> 1.35.1", require: false + gem "rubocop", "~> 1.56.2", require: false gem "rubocop-performance", "~> 1.19.0", require: false gem "rubocop-rails", "~> 2.20.2", require: false gem "rubocop-rspec", "~> 2.17.1", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 218e997d1..c2da51788 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,6 +91,7 @@ GEM babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) execjs (~> 2.0) + base64 (0.1.1) bcrypt (3.1.19) better_html (2.0.2) actionview (>= 6.0) @@ -306,6 +307,7 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) + language_server-protocol (3.17.0.3) launchy (2.5.2) addressable (~> 2.8) leaflet-rails (1.9.3) @@ -513,16 +515,18 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.11.0) - rubocop (1.35.1) + rubocop (1.56.2) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.20.1, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) + unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) parser (>= 3.2.1.0) rubocop-performance (1.19.0) @@ -742,7 +746,7 @@ DEPENDENCIES rinku (~> 2.0.6) ros-apartment (~> 2.11.0) rspec-rails (~> 5.1.2) - rubocop (~> 1.35.1) + rubocop (~> 1.56.2) rubocop-performance (~> 1.19.0) rubocop-rails (~> 2.20.2) rubocop-rspec (~> 2.17.1) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 197fbccd7..086a4265b 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -270,7 +270,7 @@ class Budget return permission_problem(user) if permission_problem?(user) return :different_heading_assigned unless valid_heading?(user) - return :no_selecting_allowed unless budget.selecting? + :no_selecting_allowed unless budget.selecting? end def reason_for_not_being_ballotable_by(user, ballot) diff --git a/app/models/legislation/proposal.rb b/app/models/legislation/proposal.rb index 8a151e56b..ec653d4c3 100644 --- a/app/models/legislation/proposal.rb +++ b/app/models/legislation/proposal.rb @@ -73,7 +73,7 @@ class Legislation::Proposal < ApplicationRecord def self.search_by_code(terms) matched_code = match_code(terms) results = where(id: matched_code[1]) if matched_code - return results if results.present? && results.first.code == terms + results if results.present? && results.first.code == terms end def self.match_code(terms) diff --git a/app/models/proposal.rb b/app/models/proposal.rb index c680cdc0b..f1e4f7198 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -145,7 +145,7 @@ class Proposal < ApplicationRecord def self.search_by_code(terms) matched_code = match_code(terms) results = where(id: matched_code[1]) if matched_code - return results if results.present? && results.first.code == terms + results if results.present? && results.first.code == terms end def self.match_code(terms) diff --git a/spec/factories/analytics.rb b/spec/factories/analytics.rb index 360eeeaad..bc7fa2654 100644 --- a/spec/factories/analytics.rb +++ b/spec/factories/analytics.rb @@ -5,7 +5,7 @@ FactoryBot.define do sequence(:name) { |n| "Event #{n} type" } end - factory :visit do + factory :visit do id { SecureRandom.uuid } started_at { DateTime.current } end diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb index e60642501..f573505bf 100644 --- a/spec/models/setting_spec.rb +++ b/spec/models/setting_spec.rb @@ -171,7 +171,7 @@ describe Setting do describe ".accepted_content_types_for" do it "returns the formats accepted according to the setting value" do - Setting["uploads.images.content_types"] = "image/jpeg image/gif" + Setting["uploads.images.content_types"] = "image/jpeg image/gif" Setting["uploads.documents.content_types"] = "application/pdf application/msword" expect(Setting.accepted_content_types_for("images")).to eq ["jpg", "gif"]