Skip to content

Commit

Permalink
Update RuboCop & fix offenses by new lints (#714)
Browse files Browse the repository at this point in the history
* Update rubocop-related Gems

* Safe autocorrect Lint/SafeNavigationConsistency

* Increase max for Style/SafeNavigationChainLength

* Increase max of safe navigation chain length to 4
  • Loading branch information
Splines authored Dec 1, 2024
1 parent 7dd3a33 commit e97ec8a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .config/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Style/MethodCallWithArgsParentheses:
Style/RedundantReturn:
AllowMultipleReturnValues: true

Style/SafeNavigationChainLength:
Max: 4

Style/StringLiterals:
EnforcedStyle: double_quotes

Expand Down
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.7)
domain_name (~> 0.5)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
image_processing (1.13.0)
mini_magick (>= 4.9.5, < 5)
Expand All @@ -294,7 +294,7 @@ GEM
js-routes (1.4.9)
railties (>= 4)
sprockets-rails
json (2.7.2)
json (2.8.2)
jsonapi-renderer (0.2.2)
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand Down Expand Up @@ -342,15 +342,15 @@ GEM
mime-types-data (3.2024.0903)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.25.1)
minitest (5.25.2)
mobility (1.2.9)
i18n (>= 0.6.10, < 2)
request_store (~> 1.0)
msgpack (1.7.2)
multi_json (1.15.0)
multipart-post (2.4.1)
mustache (1.1.1)
mutex_m (0.2.0)
mutex_m (0.3.0)
net-imap (0.4.16)
date
net-protocol
Expand All @@ -375,7 +375,7 @@ GEM
orm_adapter (0.5.0)
pairing_heap (3.1.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pdf-reader (2.12.0)
Expand Down Expand Up @@ -410,7 +410,7 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
Expand Down Expand Up @@ -513,7 +513,7 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.66.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -523,12 +523,12 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.0)
rubocop-rails (2.27.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down Expand Up @@ -631,7 +631,7 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/submissions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def submission_color(submission, assignment)
else
return "bg-submission-darker-green" if submission&.correction

if submission&.manuscript && submission&.too_late?
if submission&.manuscript && submission.too_late?
return "bg-submission-orange" if submission.accepted.nil?
return "bg-submission-green" if submission.accepted

Expand All @@ -58,7 +58,7 @@ def submission_status_icon(submission, assignment)
else
return "far fa-smile" if submission&.correction

if submission&.manuscript && submission&.too_late?
if submission&.manuscript && submission.too_late?
return "fas fa-hourglass-start" if submission.accepted

return "fas fa-exclamation-triangle"
Expand All @@ -76,7 +76,7 @@ def submission_status_text(submission, assignment)
else
return t("submission.with_correction") if submission&.correction

if submission&.manuscript && submission&.too_late?
if submission&.manuscript && submission.too_late?
return t("submission.too_late") if submission.accepted.nil?
return t("submission.too_late_accepted") if submission.accepted

Expand Down

0 comments on commit e97ec8a

Please sign in to comment.