rubocop-vendor 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aaeec03267633acaabb79d26b67a746cbf6f6c948caf17a23d09f849c848e28
4
- data.tar.gz: ae8181215d4429dc949c8be90b2bed61edc6537a5594d303abf464609cc6020a
3
+ metadata.gz: 0a33862f683a309f1600a568b4eeb7b4f52e5eed2bd2ea5fede18abaf9d561e8
4
+ data.tar.gz: c82795011f42d2defeda94fc5449a0dc5467e4d98989fbe7fa3b900e13fc3d68
5
5
  SHA512:
6
- metadata.gz: ab196d519384425d33f216d7d62c92f3d0f78a57784375ffebb920810cb40ad4e0120c1bdd9a82e0ac6192697b7e93ae0d0c4ce6866f1f945eefc35be184fd85
7
- data.tar.gz: 5cd67595559509195643f091ef0ee35cde3e67b9b11e128360cbd76e6d0c087b568efe3055fc78a5b61aff7ab0726cb5ad6fb4da8ef246960896a22f8b0218dc
6
+ metadata.gz: 424caf7dec430127f8e22d628094c5e133c71c8d6eee4fb4511a6bad1ac4fa6cfc8e1cd1d7a6f00caa0828f20662216569c992b5637590b17ebf43f462674d23
7
+ data.tar.gz: 5fbe0dac05a5d3e43a08c194e5889d7bf4f062fba87bc3405791a090d06f1d611a108e8f5c8c3eb848a5c38860187d4e14fecef04b819a459941abcafa8c78aa
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Vendor
6
+ # This cop flags uses of the sidekiq-throttled gem.
7
+ #
8
+ # sidekiq-throttled overrides sidekiq-pro and sidekiq-enterprise features,
9
+ # resulting in at-most once delivery of sidekiq jobs, instead of at-least once delivery
10
+ # of sidekiq jobs. This means there is a relatively good chance you will LOSE JOBS that were enqueued
11
+ # if the sidekiq-process runs out of memory or does not shutdown gracefully.
12
+ #
13
+ # https://wealthsimple.slack.com/archives/C19UB3HNZ/p1683721247371709 for more details
14
+ class SidekiqThrottledGem < Base
15
+ MSG = <<~MSG.strip
16
+ Do not use the sidekiq-throttled gem. sidekiq-throttled overrides the fetcher of sidekiq-pro and sidekiq-enterprise resulting in the ability to lose jobs (switch to at-most once processing).
17
+ MSG
18
+
19
+ def on_new_investigation
20
+ return if processed_source.blank?
21
+
22
+ gem_declarations(processed_source.ast).each do |declaration|
23
+ next unless declaration.first_argument.str_content.match?('sidekiq-throttled')
24
+
25
+ add_offense(declaration)
26
+ end
27
+ end
28
+
29
+ # @!method gem_declarations(node)
30
+ def_node_search :gem_declarations, <<~PATTERN
31
+ (:send nil? :gem str ...)
32
+ PATTERN
33
+ end
34
+ end
35
+ end
36
+ end
@@ -4,6 +4,7 @@ module RuboCop
4
4
  end
5
5
 
6
6
  require_relative 'vendor/recursive_open_struct_gem'
7
+ require_relative 'vendor/sidekiq_throttled_gem'
7
8
  require_relative 'vendor/recursive_open_struct_use'
8
9
  require_relative 'vendor/rollbar_inside_rescue'
9
10
  require_relative 'vendor/rollbar_interpolation'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Vendor
5
- VERSION = '0.9.2'
5
+ VERSION = '0.10.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-vendor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Cabello
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-04-14 00:00:00.000000000 Z
13
+ date: 2023-05-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -90,6 +90,7 @@ files:
90
90
  - lib/rubocop/cop/vendor/rollbar_log.rb
91
91
  - lib/rubocop/cop/vendor/rollbar_logger.rb
92
92
  - lib/rubocop/cop/vendor/rollbar_with_exception.rb
93
+ - lib/rubocop/cop/vendor/sidekiq_throttled_gem.rb
93
94
  - lib/rubocop/cop/vendor/strict_dry_struct.rb
94
95
  - lib/rubocop/cop/vendor_cops.rb
95
96
  - lib/rubocop/vendor.rb