]> cat aescling's git repositories - mastodon.git/commitdiff
Change RuboCop rules to loose (#4464)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Mon, 31 Jul 2017 13:19:13 +0000 (22:19 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 31 Jul 2017 13:19:13 +0000 (15:19 +0200)
.rubocop.yml
app/lib/emoji.rb
app/services/batched_remove_status_service.rb
app/workers/pubsubhubbub/distribution_worker.rb

index 1cbdadd49fe5a3119c36a810f13b10b4354abeff..ae36971747498e57487b01440c7f338b5af6e5f2 100644 (file)
@@ -27,6 +27,7 @@ Metrics/AbcSize:
   Max: 100
 
 Metrics/BlockLength:
+  Max: 35
   Exclude:
     - 'lib/tasks/**/*'
 
@@ -35,10 +36,10 @@ Metrics/BlockNesting:
 
 Metrics/ClassLength:
   CountComments: false
-  Max: 200
+  Max: 300
 
 Metrics/CyclomaticComplexity:
-  Max: 15
+  Max: 25
 
 Metrics/LineLength:
   AllowURI: true
@@ -53,11 +54,11 @@ Metrics/ModuleLength:
   Max: 200
 
 Metrics/ParameterLists:
-  Max: 4
+  Max: 5
   CountKeywordArgs: true
 
 Metrics/PerceivedComplexity:
-  Max: 10
+  Max: 20
 
 Rails:
   Enabled: true
index 6de70e9b4127cb5f4ab7a213d179aedd6d9e4b32..45b7f53deca522ea0be1fd91dafeb150cbaf7c72 100644 (file)
@@ -6,7 +6,7 @@ class Emoji
   include Singleton
 
   def initialize
-    data = Oj.load(File.open(File.join(Rails.root, 'lib', 'assets', 'emoji.json')))
+    data = Oj.load(File.open(Rails.root.join('lib', 'assets', 'emoji.json')))
 
     @map = {}
 
index b462154ae764840fa0bbb49278dcb1db1550638e..ab810c628eda95a9c8d05e20bfa5564f0f9d6f58 100644 (file)
@@ -90,7 +90,7 @@ class BatchedRemoveStatusService < BaseService
     key = FeedManager.instance.key(:home, follower_id)
 
     originals = statuses.reject(&:reblog?)
-    reblogs   = statuses.reject { |s| !s.reblog? }
+    reblogs   = statuses.select(&:reblog?)
 
     # Quickly remove all originals
     redis.pipelined do
index ce467d18b1d61edeb8514c1e46e3dbf7d2486a62..ea246128d2c3a3d0fe03636998665be37ddbfa02 100644 (file)
@@ -14,7 +14,7 @@ class Pubsubhubbub::DistributionWorker
     @subscriptions = active_subscriptions.to_a
 
     distribute_public!(stream_entries.reject(&:hidden?))
-    distribute_hidden!(stream_entries.reject { |s| !s.hidden? })
+    distribute_hidden!(stream_entries.select(&:hidden?))
   end
 
   private
@@ -35,7 +35,7 @@ class Pubsubhubbub::DistributionWorker
     @payload = OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, stream_entries))
     @domains = @account.followers.domains
 
-    Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions.reject { |s| !allowed_to_receive?(s.callback_url, s.domain) }) do |subscription|
+    Pubsubhubbub::DeliveryWorker.push_bulk(@subscriptions.select { |s| allowed_to_receive?(s.callback_url, s.domain) }) do |subscription|
       [subscription.id, @payload]
     end
   end