rubocop-vendor 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d60149702eeab325d9a01d3cc342cb3f3c17cd3b5259035471861d7fc8b82a9f
4
- data.tar.gz: c4217f8e309e715753c8b8b967407b2a0bbc87eb5f4be16e645cbc8927800a0e
3
+ metadata.gz: 0a33862f683a309f1600a568b4eeb7b4f52e5eed2bd2ea5fede18abaf9d561e8
4
+ data.tar.gz: c82795011f42d2defeda94fc5449a0dc5467e4d98989fbe7fa3b900e13fc3d68
5
5
  SHA512:
6
- metadata.gz: 3f9ae4df44bab2e0d5b769c3c5d625ba9f005d07b24fc39991b367db317c1acfe5d1605d6eb33457a2c092a473a882a96b67b47f89334f2ccd88ca51a8e72481
7
- data.tar.gz: f3a3b42987b7be2a7b6bc1307e1ba78ce09143089e53d43a8bc9ac16d7f285f5c90049d243be90846c0cd67ca345dfd39ffdb385bc223d6cad03ccd5e716cbac
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.1'
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.1
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-03-17 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
@@ -113,14 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
114
  requirements:
114
115
  - - ">="
115
116
  - !ruby/object:Gem::Version
116
- version: '2.7'
117
+ version: '3.0'
117
118
  required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  requirements:
119
120
  - - ">="
120
121
  - !ruby/object:Gem::Version
121
122
  version: '0'
122
123
  requirements: []
123
- rubygems_version: 3.1.6
124
+ rubygems_version: 3.2.33
124
125
  signing_key:
125
126
  specification_version: 4
126
127
  summary: Automatic vendor integration checking tool for Ruby code.