You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For /Users/cody/src/inst-jobs: configuration from /Users/cody/src/inst-jobs/.rubocop.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rails-2.12.2/config/default.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rails-2.12.2/config/default.yml
Default configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-1.21.0/config/default.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rake-0.6.0/config/default.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rake-0.6.0/config/default.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rspec-2.5.0/config/default.yml
configuration from /Users/cody/.gem/ruby/2.7.2/gems/rubocop-rspec-2.5.0/config/default.yml
Use parallel by default.
Running parallel inspection
Loading cache from /Users/cody/.cache/rubocop_cache/c6e7bb119f0c0f52ccd63d4e1409d8a6f230f3ab/62a2053d41eb97fee50d7702bbb1b9ef8ecff8a4/6c68e4455f826a7733bbff3337b441b66287c5af
Inspecting 1 file
Scanning /Users/cody/src/inst-jobs/test.rb
Loading cache from /Users/cody/.cache/rubocop_cache/c6e7bb119f0c0f52ccd63d4e1409d8a6f230f3ab/62a2053d41eb97fee50d7702bbb1b9ef8ecff8a4/6c68e4455f826a7733bbff3337b441b66287c5af
W
Offenses:
test.rb:2:42: W: Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
submission = @gradebook_importer_assignments[student.id][idx]
^
test.rb:6:51: W: Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
submission['grade'] = 'EX' if submission['grade'].to_s.casecmp('EX') == 0
^
test.rb:7:41: W: Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
no_change = no_change_to_submission?(submission)
^
test.rb:9:92: W: Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
@warning_messages[:prevented_grading_ungradeable_submission] =
^
1 file inspected, 4 offenses detected
Finished in 0.7389060000423342 seconds
Steps to reproduce the problem
test.rb:
indexes_to_delete << idx if readonly_assignment?(assignment) || @students.all? do |student|
submission = @gradebook_importer_assignments[student.id][idx]
# Have potentially mixed case excused in grade match case
# expectations for the compare so it doesn't look changed
submission['grade'] = 'EX' if submission['grade'].to_s.casecmp('EX') == 0
no_change = no_change_to_submission?(submission)
@warning_messages[:prevented_grading_ungradeable_submission] =
true if !submission['gradeable'] && !no_change
no_change || !submission['gradeable']
end
The file in the reproduction steps section shouldn't report any errors for this linter.
Expected behavior
No offenses are shown for this code.
Actual behavior
rubocop --debug --only Lint/AssignmentInCondition -- test.rb
gives
Steps to reproduce the problem
test.rb:
RuboCop version
The text was updated successfully, but these errors were encountered: