Skip to content

Commit

Permalink
Merge pull request #238 from winebarrel/enable_Naming/Uncommunicative…
Browse files Browse the repository at this point in the history
…MethodParamName

Enable Naming/UncommunicativeMethodParamName
  • Loading branch information
winebarrel committed Jun 12, 2018
2 parents 30d5d25 + 966cef6 commit 5de20d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Naming/UncommunicativeMethodParamName:
Enabled: false
Performance/StringReplacement:
Enabled: false
Style/ClassAndModuleChildren:
Expand Down
4 changes: 2 additions & 2 deletions lib/ridgepole/delta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def raise_exception(script, org)
raise e
end

def detect_error_line(e)
def detect_error_line(exception)
rgx = /\A#{Regexp.escape(SCRIPT_NAME)}:(\d+):/
line = e.backtrace.find { |i| i =~ rgx }
line = exception.backtrace.find { |i| i =~ rgx }

if line && (m = rgx.match(line))
m[1].to_i
Expand Down
18 changes: 9 additions & 9 deletions lib/ridgepole/ext/pp_sort_hash.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Ridgepole
module Ext
module PpSortHash
def pretty_print(q)
q.group(1, '{', '}') do
q.seplist(sort_by { |k, _| k.to_s }, nil, :each) do |k, v|
def pretty_print(pp_obj)
pp_obj.group(1, '{', '}') do
pp_obj.seplist(sort_by { |k, _| k.to_s }, nil, :each) do |k, v|
v = PpSortHash.extend_if_hash(v)

q.group do
q.pp k
q.text '=>'
q.group(1) do
q.breakable ''
q.pp v
pp_obj.group do
pp_obj.pp k
pp_obj.text '=>'
pp_obj.group(1) do
pp_obj.breakable ''
pp_obj.pp v
end
end
end
Expand Down

0 comments on commit 5de20d2

Please sign in to comment.