Skip to content

Commit 6986504

Browse files
author
Josh Lory
committed
bundle exec rubocop --only Style/AlignParameters --auto-correct
1 parent cd2de05 commit 6986504

56 files changed

Lines changed: 414 additions & 419 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,35 @@ AllCops:
1111
DisplayCopNames: true
1212
TargetRubyVersion: 2.2
1313

14-
# Listed are rules we don't plan to enable in the foreseeable future.
15-
# Add rules we plan to fix (but are currently failing) to .rubocop_todo.yml.
16-
17-
Style/BarePercentLiterals:
18-
Enabled: false
14+
# Code.org style overrides.
1915

20-
Style/ClosingParenthesisIndentation:
21-
Enabled: false
16+
Style/AlignParameters:
17+
EnforcedStyle: with_fixed_indentation
2218

23-
# Require trailing dots for method chaining in ruby
24-
# example:
25-
# MyObject.
26-
# myMethod().
27-
# mySecondMethod()
2819
Style/DotPosition:
2920
EnforcedStyle: trailing
3021

3122
Style/EmptyLineBetweenDefs:
3223
AllowAdjacentOneLineDefs: true
3324

25+
Style/NumericLiterals:
26+
MinDigits: 7
27+
28+
Style/Semicolon:
29+
AllowAsExpressionSeparator: true
30+
31+
Style/WordArray:
32+
MinSize: 5
33+
34+
# Listed below are rules we don't plan to enable in the foreseeable future.
35+
# Add rules we plan to fix (but are currently failing) to .rubocop_todo.yml.
36+
37+
Style/BarePercentLiterals:
38+
Enabled: false
39+
40+
Style/ClosingParenthesisIndentation:
41+
Enabled: false
42+
3443
Style/ExtraSpacing:
3544
Enabled: false
3645

@@ -43,9 +52,6 @@ Style/IfInsideElse:
4352
Style/RedundantReturn:
4453
Enabled: false
4554

46-
Style/WordArray:
47-
MinSize: 5
48-
4955
Metrics/AbcSize:
5056
Enabled: false
5157

@@ -58,11 +64,5 @@ Metrics/ModuleLength:
5864
Metrics/BlockNesting:
5965
Enabled: false
6066

61-
Style/Semicolon:
62-
AllowAsExpressionSeparator: true
63-
64-
Style/NumericLiterals:
65-
MinDigits: 7
66-
6767
Style/AsciiComments:
6868
Enabled: false

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ Style/AlignArray:
7777
Style/AlignHash:
7878
Enabled: false
7979

80-
# Offense count: 42
81-
# Cop supports --auto-correct.
82-
# Configuration parameters: EnforcedStyle, SupportedStyles.
83-
# SupportedStyles: with_first_parameter, with_fixed_indentation
84-
Style/AlignParameters:
85-
Enabled: false
86-
8780
# Offense count: 47
8881
# Cop supports --auto-correct.
8982
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.

bin/i18n-codeorg/lib/merge-all-locales.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
2424
if en_translation.has_key?(key) && prev_translation.has_key?(key)
2525
new_translation[key] =
2626
merge_translation_tree(en_translation[key],
27-
new_translation[key],
28-
prev_translation[key])
27+
new_translation[key],
28+
prev_translation[key])
2929
end
3030
end
3131
en_translation.each_key do |key|
@@ -56,8 +56,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
5656
# Get new translation
5757
new_translation[new_translation.keys[0]] =
5858
merge_translation_tree(en_translation.values[0],
59-
new_translation.values[0],
60-
prev_translation.values[0])
59+
new_translation.values[0],
60+
prev_translation.values[0])
6161

6262
File.open(prev_translation_path, 'w+') do |f|
6363
f.write(new_translation.to_yaml)
@@ -69,8 +69,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
6969

7070
# Get new translation
7171
new_translation = merge_translation_tree(en_translation,
72-
new_translation,
73-
prev_translation)
72+
new_translation,
73+
prev_translation)
7474

7575
File.open(prev_translation_path, 'w+') do |f|
7676
f.write(JSON.pretty_generate(new_translation))

bin/i18n-codeorg/lib/merge-translation.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
2424
if en_translation.has_key?(key) && prev_translation.has_key?(key)
2525
new_translation[key] =
2626
merge_translation_tree(en_translation[key],
27-
new_translation[key],
28-
prev_translation[key])
27+
new_translation[key],
28+
prev_translation[key])
2929
end
3030
end
3131
end
@@ -51,8 +51,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
5151
# Get new translation
5252
new_translation[new_translation.keys[0]] =
5353
merge_translation_tree(en_translation.values[0],
54-
new_translation.values[0],
55-
prev_translation.values[0])
54+
new_translation.values[0],
55+
prev_translation.values[0])
5656

5757
File.open(prev_translation_path, 'w+') do |f|
5858
f.write(new_translation.to_yaml)
@@ -64,8 +64,8 @@ def merge_translation_tree(en_translation, new_translation, prev_translation)
6464

6565
# Get new translation
6666
new_translation = merge_translation_tree(en_translation,
67-
new_translation,
68-
prev_translation)
67+
new_translation,
68+
prev_translation)
6969

7070
File.open(prev_translation_path, 'w+') do |f|
7171
f.write(JSON.pretty_generate(new_translation))

dashboard/app/controllers/admin_funometer_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def funometer_by_stage
6464
@ratings_by_level_headers = ['Level ID', 'Level Name', 'Percentage', 'Count']
6565
@ratings_by_level = ratings_by_level.
6666
select('level_id',
67-
'name',
68-
'100.0 * SUM(rating) / COUNT(rating) AS percentage',
69-
'COUNT(rating) AS cnt')
67+
'name',
68+
'100.0 * SUM(rating) / COUNT(rating) AS percentage',
69+
'COUNT(rating) AS cnt')
7070
end
7171
end
7272

dashboard/app/controllers/level_source_hints_controller.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ def show_pop_hints
141141
authorize! :manage, :all
142142

143143
unless setup_display_of_pop_hints(
144-
FrequentUnsuccessfulLevelSource,
145-
lambda {|idx, restriction| show_pop_hints_path idx, restriction})
144+
FrequentUnsuccessfulLevelSource,
145+
lambda {|idx, restriction| show_pop_hints_path idx, restriction})
146146
redirect_to frequent_unsuccessful_level_sources_path,
147-
notice: "No more #{@restriction && LevelSourceHint::USER_VISIBLE_NAMES[@restriction]} hints to review."
147+
notice: "No more #{@restriction && LevelSourceHint::USER_VISIBLE_NAMES[@restriction]} hints to review."
148148
end
149149
end
150150

@@ -163,20 +163,20 @@ def add_pop_hint_per_level
163163
render 'add_pop_hint'
164164
else
165165
redirect_to frequent_unsuccessful_level_sources_path,
166-
notice: 'No more hints are needed for the level you chose. Please select another.'
166+
notice: 'No more hints are needed for the level you chose. Please select another.'
167167
end
168168
end
169169

170170
def show_pop_hints_per_level
171171
authorize! :manage, :all
172172

173173
if setup_display_of_pop_hints(
174-
FrequentUnsuccessfulLevelSource.where(level_id: params[:level_id].to_i),
175-
lambda {|idx, restriction| show_pop_hints_per_level_path(params[:level_id].to_i, idx, restriction)})
174+
FrequentUnsuccessfulLevelSource.where(level_id: params[:level_id].to_i),
175+
lambda {|idx, restriction| show_pop_hints_per_level_path(params[:level_id].to_i, idx, restriction)})
176176
render 'show_pop_hints'
177177
else
178178
redirect_to frequent_unsuccessful_level_sources_path,
179-
notice: "No more #{@restriction && LevelSourceHint::USER_VISIBLE_NAMES[@restriction]} hints to review for the chosen level."
179+
notice: "No more #{@restriction && LevelSourceHint::USER_VISIBLE_NAMES[@restriction]} hints to review for the chosen level."
180180
end
181181
end
182182

dashboard/app/controllers/media_proxy_controller.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class MediaProxyController < ApplicationController
2626
# Return the proxied media at the given URL.
2727
def get
2828
render_proxied_url(
29-
params[:u],
30-
allowed_content_types: ALLOWED_CONTENT_TYPES,
31-
allowed_hostname_suffixes: nil, # allow any hostname
32-
expiry_time: EXPIRY_TIME,
33-
infer_content_type: true)
29+
params[:u],
30+
allowed_content_types: ALLOWED_CONTENT_TYPES,
31+
allowed_hostname_suffixes: nil, # allow any hostname
32+
expiry_time: EXPIRY_TIME,
33+
infer_content_type: true)
3434
end
3535
end

dashboard/app/controllers/ops/workshop_attendance_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ def destroy
167167
# (see: http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters)
168168
def workshop_attendance_params
169169
params.require(:workshop_attendance).permit(
170-
:teacher_id,
171-
:segment_id,
172-
:status,
173-
:notes
170+
:teacher_id,
171+
:segment_id,
172+
:status,
173+
:notes
174174
)
175175
end
176176
end

dashboard/app/controllers/xhr_proxy_controller.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def get
6262
Rails.logger.info "XhrProxyControllerRequest #{event_details}"
6363

6464
render_proxied_url(
65-
url,
66-
allowed_content_types: ALLOWED_CONTENT_TYPES,
67-
allowed_hostname_suffixes: ALLOWED_HOSTNAME_SUFFIXES,
68-
expiry_time: EXPIRY_TIME,
69-
infer_content_type: false)
65+
url,
66+
allowed_content_types: ALLOWED_CONTENT_TYPES,
67+
allowed_hostname_suffixes: ALLOWED_HOSTNAME_SUFFIXES,
68+
expiry_time: EXPIRY_TIME,
69+
infer_content_type: false)
7070
end
7171
end

dashboard/app/helpers/application_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def signup_error_messages!
173173
sentence = resource.oauth? ?
174174
I18n.t("signup_form.additional_information") :
175175
I18n.t("errors.messages.not_saved",
176-
count: resource.errors.count,
177-
resource: resource.class.model_name.human.downcase)
176+
count: resource.errors.count,
177+
resource: resource.class.model_name.human.downcase)
178178

179179
html = <<-HTML
180180
<div id="error_explanation">

0 commit comments

Comments
 (0)