diff --git a/.rubocop.yml b/.rubocop.yml index ddeef6af..e1ef9a28 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -203,3 +203,6 @@ Style/SymbolArray: Style/WordArray: Enabled: false + +Style/YodaExpression: + Enabled: false diff --git a/Gemfile b/Gemfile index 93eb9f75..9fb5c1e9 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,7 @@ gem 'bootsnap', '>= 1.4.5', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri - gem 'rubocop', '~> 1.39.0', require: false + gem 'rubocop', '~> 1.42.0', require: false gem 'rubocop-performance', '~> 1.15.2' gem 'rubocop-rails', '~> 2.17.4' gem 'dotenv-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 36c6933e..2488bd71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -277,14 +277,14 @@ GEM sinatra (>= 0.9.2) retriable (3.1.2) rexml (3.2.5) - rubocop (1.39.0) + rubocop (1.42.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.24.1) @@ -397,7 +397,7 @@ DEPENDENCIES rails (~> 7.0.4) redis (~> 5.0) resque (~> 2.4.0) - rubocop (~> 1.39.0) + rubocop (~> 1.42.0) rubocop-performance (~> 1.15.2) rubocop-rails (~> 2.17.4) sassc-rails (~> 2.1.2) diff --git a/app/controllers/api/v0/versions_controller.rb b/app/controllers/api/v0/versions_controller.rb index 0c1111eb..4111674d 100644 --- a/app/controllers/api/v0/versions_controller.rb +++ b/app/controllers/api/v0/versions_controller.rb @@ -48,7 +48,7 @@ def sampled end next_version = page.versions.where('capture_time < ?', time_range[0]).select(:uuid, :capture_time).first - if samples.length.zero? && next_version.nil? + if samples.empty? && next_version.nil? raise Api::NotFoundError, '`to` time is older than the oldest version' end