Skip to content

Commit

Permalink
Enable RedundantReturn rucobop style
Browse files Browse the repository at this point in the history
  • Loading branch information
dieggofaustino committed Sep 4, 2017
1 parent 0acf24c commit f88ba95
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Documentation:
Style/Semicolon:
AllowAsExpressionSeparator: true

Style/RedundantReturn:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Added flag to mail reports
- Enabled AndOr rubocop style
- Enabled BlockNesting rubocop metric
- Enabled RedundantReturn rubocop style

### Changed
- Move users/form from projects to teams
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/sidebar_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def define_sidebar(sidebar)
end

def sidebar
return @sidebar
@sidebar
end
end
end
22 changes: 11 additions & 11 deletions lib/tasks/i18n_missing_keys.rake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MissingKeysFinder
end

output_missing_keys(missing_keys)
return missing_keys
missing_keys
end

def add_missing_key(missing_keys, key, locale, skip)
Expand Down Expand Up @@ -75,18 +75,18 @@ class MissingKeysFinder
end

def collect_keys(scope, translations)
full_keys = []
translations.to_a.each do |key, translation|
next if translation.nil?

new_scope = scope.dup << key
if translation.is_a?(Hash)
full_keys += collect_keys(new_scope, translation)
else
full_keys << new_scope.join('.')
[].tap do |full_keys|
translations.to_a.each do |key, translation|
next if translation.nil?

new_scope = scope.dup << key
if translation.is_a?(Hash)
full_keys += collect_keys(new_scope, translation)
else
full_keys << new_scope.join('.')
end
end
end
return full_keys
end

# Returns true if key exists in the given locale
Expand Down

0 comments on commit f88ba95

Please sign in to comment.