Skip to content

Commit

Permalink
Merge pull request #5019 from dodona-edu/dependabot/bundler/rubocop-f…
Browse files Browse the repository at this point in the history
…ae11bd22a
  • Loading branch information
bmesuere authored Oct 3, 2023
2 parents 09c913b + 570fbc0 commit 12f2329
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ group :development do
gem 'web-console', '~> 4.2.1'

gem 'rb-readline', '~> 0.5.5' # require for irb
gem 'rubocop-capybara', '~> 2.18.0'
gem 'rubocop-capybara', '~> 2.19.0'
gem 'rubocop-factory_bot', '~> 2.24'
gem 'rubocop-minitest', '~> 0.31.1'
gem 'rubocop-rails', '~> 2.21.1'
gem 'rubocop-minitest', '~> 0.32.2'
gem 'rubocop-rails', '~> 2.21.2'

# for opening letters
gem 'letter_opener', '~> 1.8.1'
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ GEM
railties (>= 5.2)
rexml (3.2.6)
rouge (4.1.3)
rubocop (1.56.3)
rubocop (1.56.4)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand All @@ -420,13 +420,13 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-minitest (0.31.1)
rubocop-minitest (0.32.2)
rubocop (>= 1.39, < 2.0)
rubocop-rails (2.21.1)
rubocop-rails (2.21.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand Down Expand Up @@ -489,7 +489,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
Expand Down Expand Up @@ -589,10 +589,10 @@ DEPENDENCIES
rails-i18n (~> 7.0.8)
rb-readline (~> 0.5.5)
rouge (= 4.1.3)
rubocop-capybara (~> 2.18.0)
rubocop-capybara (~> 2.19.0)
rubocop-factory_bot (~> 2.24)
rubocop-minitest (~> 0.31.1)
rubocop-rails (~> 2.21.1)
rubocop-minitest (~> 0.32.2)
rubocop-rails (~> 2.21.2)
ruby-saml (~> 1.15.0)
rubyzip (~> 2.3.2)
selenium-webdriver (~> 4.13.1)
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/renderers/feedback_table_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def show_code_tab

def show_diff_type_switch(tab)
tab[:groups]&.compact # Groups
&.flat_map { |t| t[:groups] }&.compact # Testcases
&.flat_map { |t| t[:tests] }&.compact # Tests
&.reject { |t| t[:accepted] }
&.any?
&.flat_map { |t| t[:groups] }&.compact # Testcases
&.flat_map { |t| t[:tests] }&.compact # Tests
&.reject { |t| t[:accepted] }
&.any?
end

def show_hide_correct_switch(tab)
Expand Down
2 changes: 1 addition & 1 deletion app/models/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def read_dirconfig(subdir)

def read_config_locations(location)
repository.read_config_file(location)
&.deep_transform_values! { location }
&.deep_transform_values! { location }
end

def config_locations
Expand Down
2 changes: 1 addition & 1 deletion app/runners/submission_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def execute
while Time.zone.now - before_time < time_limit
before_stats = Time.zone.now
# Check if container is still running
if !Rails.env.test? && (Docker::Container.all.any? { |c| c.id.starts_with?(container.id) || container.id.starts_with?(container.id) } && container.refresh!.info['State']['Running']) # rubocop:disable Rails/RedundantActiveRecordAllMethod
if !Rails.env.test? && (Docker::Container.all.any? { |c| c.id.starts_with?(container.id) || container.id.starts_with?(container.id) } && container.refresh!.info['State']['Running'])
# If we don't pass these extra options gathering stats takes 1+ seconds (https://github.com/moby/moby/issues/23188#issuecomment-223211481)
stats = container.stats({ 'one-shot': true, stream: false })
memory = [stats['memory_stats']['usage'] / (1024.0 * 1024.0), memory].max if stats['memory_stats']&.fetch('usage', nil)
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/application_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest

assert_response :success
assert_not_equal session[:user_return_to], location
assert session[:user_return_to].length < 100
assert_operator session[:user_return_to].length, :<, 100
end

test 'should get unauthorized status when not logged in' do
Expand Down
2 changes: 1 addition & 1 deletion test/models/api_token_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ApiTokenTest < ActiveSupport::TestCase

test 'api token creation' do
assert_not_nil @api_token
assert @api_token.token.length > 30
assert_operator @api_token.token.length, :>, 30
assert_not_nil @api_token.token_digest
assert_equal ApiToken.digest(@token), @api_token.token_digest
end
Expand Down
4 changes: 2 additions & 2 deletions test/models/feedback_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class FeedbackTest < ActiveSupport::TestCase
end

test 'Appropriate amount of feedbacks are created when making a session and when updating' do
assert @user_count > 1
assert @exercise_count > 1
assert_operator @user_count, :>, 1
assert_operator @exercise_count, :>, 1
assert_equal @user_count * @exercise_count, @evaluation.feedbacks.count

user_to_remove = @users.sample
Expand Down
4 changes: 2 additions & 2 deletions test/system/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def assert_path_with_query(path, **query_params)
test 'Going to a page with search does not create an extra history entry' do
sign_in create(:zeus)
visit root_path
click_on 'Toggle drawer'
click_on 'Exercises'
click_button 'Toggle drawer'
click_link 'Exercises'

page.assert_current_path activities_path
page.go_back
Expand Down

0 comments on commit 12f2329

Please sign in to comment.