Skip to content

Commit

Permalink
Lower BlockNesting threashold
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Feb 14, 2014
1 parent 328f68c commit 12be9bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
28 changes: 13 additions & 15 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ ParameterLists:
Max: 3
CountKeywordArgs: true

# Thor makes it hard to write short classes
ClassLength:
Enabled: false

LineLength:
Enabled: false

# Thor makes it hard to write short methods
MethodLength:
Enabled: false

# Avoid more than `Max` levels of nesting.
BlockNesting:
Max: 3
Max: 2

# This threashold should be lowered back down to 6 over time
CyclomaticComplexity:
Max: 11
Max: 11 # TODO: Lower to 6

# Align with the style guide.
CollectionMethods:
Expand All @@ -27,10 +37,6 @@ CollectionMethods:
find: 'detect'
find_all: 'select'

# Limit line length
LineLength:
Enabled: false

# Disable documentation checking until a class needs to be documented once
Documentation:
Enabled: false
Expand Down Expand Up @@ -62,14 +68,6 @@ EmptyLinesAroundAccessModifier:
TrailingWhitespace:
Enabled: false

# Thor makes it hard to write short classes
ClassLength:
Enabled: false

# Thor makes it hard to write short methods
MethodLength:
Enabled: false

# Align ends correctly
EndAlignment:
AlignWith: variable
Expand Down
2 changes: 1 addition & 1 deletion lib/t/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def whois(user) # rubocop:disable CyclomaticComplexity
array << ['Since', "#{ls_formatted_time(user, :created_at, false)} (#{time_ago_in_words(user.created_at)} ago)"]
array << ['Last update', "#{decode_full_text(user.status, options['decode_uris']).gsub(/\n+/, ' ')} (#{time_ago_in_words(user.status.created_at)} ago)"] unless user.status.nil?
array << ['Screen name', "@#{user.screen_name}"]
array << [user.verified ? 'Name (Verified)' : 'Name', user.name] unless user.name.nil?
array << [user.verified ? 'Name (Verified)' : 'Name', user.name] unless user.name.nil? # rubocop:disable BlockNesting
array << ['Tweets', number_with_delimiter(user.statuses_count)]
array << ['Favorites', number_with_delimiter(user.favorites_count)]
array << ['Listed', number_with_delimiter(user.listed_count)]
Expand Down
2 changes: 1 addition & 1 deletion lib/t/printable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def print_users(users) # rubocop:disable CyclomaticComplexity
when 'tweets'
users.sort_by { |user| user.statuses_count.to_i }
when 'tweeted'
users.sort_by { |user| user.status? ? user.status.created_at : Time.at(0) }
users.sort_by { |user| user.status? ? user.status.created_at : Time.at(0) } # rubocop:disable BlockNesting
else
users.sort_by { |user| user.screen_name.downcase }
end unless options['unsorted']
Expand Down

0 comments on commit 12be9bb

Please sign in to comment.