Skip to content

Commit 9f607bb

Browse files
committed
Fix violations of Style/EmptyElse.
1 parent 84405f5 commit 9f607bb

6 files changed

Lines changed: 9 additions & 18 deletions

File tree

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Style/ClosingParenthesisIndentation:
2828
Style/DotPosition:
2929
EnforcedStyle: trailing
3030

31+
Style/EmptyElse:
32+
EnforcedStyle: empty
33+
3134
Style/EmptyLineBetweenDefs:
3235
AllowAdjacentOneLineDefs: true
3336

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ Style/DefWithParentheses:
162162
Style/DeprecatedHashMethods:
163163
Enabled: false
164164

165-
# Offense count: 8
166-
# Cop supports --auto-correct.
167-
# Configuration parameters: EnforcedStyle, SupportedStyles.
168-
# SupportedStyles: empty, nil, both
169-
Style/EmptyElse:
170-
Enabled: false
171-
172165
# Offense count: 27
173166
# Cop supports --auto-correct.
174167
Style/EmptyLinesAroundAccessModifier:

bin/cron/deliver_poste_messages

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ def main()
305305
message = "#{queue_count} email(s) sent in #{elapsed_seconds} seconds using #{worker_count} threads, #{remaining_count} still queued."
306306
if rack_env?(:development)
307307
puts message
308-
else
309-
# HipChat.log message
310308
end
311309
end
312310
end

dashboard/app/controllers/activities_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,16 @@ def trophy_check(user)
214214
current = current_trophies[concept]
215215
pct = counts[:current].to_f/counts[:max]
216216

217-
new_trophy = Trophy.find_by_id case
217+
new_trophy = Trophy.find_by_id(
218+
case
218219
when pct == Trophy::GOLD_THRESHOLD
219220
Trophy::GOLD
220221
when pct >= Trophy::SILVER_THRESHOLD
221222
Trophy::SILVER
222223
when pct >= Trophy::BRONZE_THRESHOLD
223224
Trophy::BRONZE
224-
else
225-
# "no trophy earned"
226-
end
225+
end
226+
)
227227

228228
if new_trophy
229229
if new_trophy.id == current.try(:trophy_id)

dashboard/app/controllers/ops/cohorts_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ def update_teachers
135135
@cohort.teachers = @cohort.teachers - teachers_in_district + teachers
136136

137137
# cannoy modify districts
138-
else
139-
# weird.
140-
# don't do anything
141138
end
142139
end
143140
end

dashboard/app/models/peer_review.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def mark_user_level
6868
# Need at least `REVIEWS_FOR_CONSENSUS` reviews to accept/reject
6969
return unless reviews.size >= REVIEWS_FOR_CONSENSUS
7070

71+
# TODO: Add an else clause with find_or_create PeerReview assigned to the
72+
# instructor.
7173
if reviews.all?(&:accepted?)
7274
user_level.update!(best_result: Activity::REVIEW_ACCEPTED_RESULT)
7375
elsif reviews.all?(&:rejected?)
7476
user_level.update!(best_result: Activity::REVIEW_REJECTED_RESULT)
75-
else
76-
# TODO: find_or_create PeerReview assigned to the instructor
7777
end
7878
end
7979

0 commit comments

Comments
 (0)