Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Lower BlockNesting threashold

  • Loading branch information...
commit 12be9bb10147d714cd2f3475fe02f456336adaee 1 parent 328f68c
@sferik authored
Showing with 15 additions and 17 deletions.
  1. +13 −15 .rubocop.yml
  2. +1 −1  lib/t/cli.rb
  3. +1 −1  lib/t/printable.rb
View
28 .rubocop.yml
@@ -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:
@@ -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
@@ -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
View
2  lib/t/cli.rb
@@ -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)]
View
2  lib/t/printable.rb
@@ -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']
Please sign in to comment.
Something went wrong with that request. Please try again.