diff --git a/Gemfile.lock b/Gemfile.lock index 4eb59394a..86f810a54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -472,7 +472,7 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.3) - rubocop (1.75.8) + rubocop (1.76.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -480,10 +480,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.45.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.45.1) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-capybara (2.22.1) @@ -941,8 +941,8 @@ CHECKSUMS rspec-mocks (3.13.4) sha256=6bb158a0719c53d522104ed34c0777b884b2c9dc775ce64eaa10207df02ab993 rspec-rails (8.0.0) sha256=977a508cd94d152db2068c6585470db5d0cd47eef56d5410b9531034fb9d97bf rspec-support (3.13.3) sha256=2a61e393f6e18b7228726e0c6869c5d5a1419d37206116c4d917d145276b3f43 - rubocop (1.75.8) sha256=c80ab4286c5dcfc49d7ad1787cdba5569b63b58c96ee7afde4ec47a9c8a85be9 - rubocop-ast (1.44.1) sha256=e3cc04203b2ef04f6d6cf5f85fe6d643f442b18cc3b23e3ada0ce5b6521b8e92 + rubocop (1.76.1) sha256=e15a2d750794cf2157d2de8b1b403dfa71b8dc3957a22ae6043b1bdf21e7e0e7 + rubocop-ast (1.45.1) sha256=94042e49adc17f187ba037b33f941ba7398fede77cdf4bffafba95190a473a3e rubocop-capybara (2.22.1) sha256=ced88caef23efea53f46e098ff352f8fc1068c649606ca75cb74650970f51c0c rubocop-factory_bot (2.27.1) sha256=9d744b5916778c1848e5fe6777cc69855bd96548853554ec239ba9961b8573fe rubocop-performance (1.25.0) sha256=6f7d03568a770054117a78d0a8e191cefeffb703b382871ca7743831b1a52ec1 diff --git a/app/controllers/concerns/redirect_behavior.rb b/app/controllers/concerns/redirect_behavior.rb index 072948c31..c10b9886e 100644 --- a/app/controllers/concerns/redirect_behavior.rb +++ b/app/controllers/concerns/redirect_behavior.rb @@ -74,7 +74,7 @@ def redirect_to_user_feedback def redirect_to_unsolved_rfc(own: false) # Set a message that informs the user that their own RFC should be closed or help in another RFC is greatly appreciated. - flash[:notice] = I18n.t("exercises.editor.exercise_finished_redirect_to_#{own ? 'own_' : ''}rfc") + flash[:notice] = I18n.t("exercises.editor.exercise_finished_redirect_to_#{'own_' if own}rfc") flash.keep(:notice) # Increase counter 'times_featured' in rfc diff --git a/app/controllers/external_users_controller.rb b/app/controllers/external_users_controller.rb index 5fc2a1199..bc9e51fa0 100644 --- a/app/controllers/external_users_controller.rb +++ b/app/controllers/external_users_controller.rb @@ -60,7 +60,7 @@ def working_time_query(tag = nil) filtered_submissions.created_at ) AS foo ) AS bar - #{tag.nil? ? '' : " JOIN exercise_tags et ON et.exercise_id = bar.exercise_id AND #{ExternalUser.sanitize_sql(['et.tag_id = ?', tag])}"} + #{" JOIN exercise_tags et ON et.exercise_id = bar.exercise_id AND #{ExternalUser.sanitize_sql(['et.tag_id = ?', tag])}" unless tag.nil?} GROUP BY contributor_id, bar.exercise_id; " diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb index deaf1a596..7d0870111 100644 --- a/app/policies/application_policy.rb +++ b/app/policies/application_policy.rb @@ -16,13 +16,13 @@ def author? end private :author? - def everyone + def everyone # rubocop:disable Naming/PredicateMethod # As the ApplicationController forces to have any authorization, `everyone` here means `every user logged in` true end private :everyone - def no_one + def no_one # rubocop:disable Naming/PredicateMethod false end private :no_one diff --git a/app/views/execution_environments/statistics.html.slim b/app/views/execution_environments/statistics.html.slim index 0266d88e9..e7053356e 100644 --- a/app/views/execution_environments/statistics.html.slim +++ b/app/views/execution_environments/statistics.html.slim @@ -26,7 +26,7 @@ h1 = @execution_environment td = us['average_score'].to_f.round(4) td = us['maximum_score'].to_f.round(2) td = us['stddev_score'].to_f.round(4) - td = (us['percent_correct'].to_f || 0).round(4) + td = us['percent_correct'].to_f.round(4) td = us['average_submission_count'].to_f.round(2) td = average_time td = stddev_time diff --git a/lib/code_ocean/config.rb b/lib/code_ocean/config.rb index 92e8b3134..513939836 100644 --- a/lib/code_ocean/config.rb +++ b/lib/code_ocean/config.rb @@ -5,7 +5,7 @@ class Config attr_reader :path, :read def initialize(filename, options = {}) - @path = Rails.root.join('config', "#{filename}.yml#{options[:erb] ? '.erb' : ''}") + @path = Rails.root.join('config', "#{filename}.yml#{'.erb' if options[:erb]}") @read = parse(options) end diff --git a/lib/runner/strategy/null.rb b/lib/runner/strategy/null.rb index 7b0d3ffb8..d07549d19 100644 --- a/lib/runner/strategy/null.rb +++ b/lib/runner/strategy/null.rb @@ -45,7 +45,7 @@ def self.available_images def self.config; end - def self.health + def self.health # rubocop:disable Naming/PredicateMethod true end