rubocop-g2 1.5.2 → 1.5.3

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: 982a0b5149f0b032cbc1507f6c73fbbefe834747ac7ccf539b5a63dcaa942a6c
4
- data.tar.gz: 88056a2738f25250eba732b682b769168289ca3d09d931b778cdb559a96a3dfb
3
+ metadata.gz: 07120a37fec4e4375c0e79528fa84951f73db52ccc8aad39839cb050c4c095da
4
+ data.tar.gz: 6ccd769129160321ce8b097427ce4a39319ab9d6787910f319762e54e08f0587
5
5
  SHA512:
6
- metadata.gz: 3d0f849b6d7db262ccacaf432bb69a957cca880479b48bb9c25989fda6b6c9f31371450d0c050ad9a93a06ca26bd13279b2a7da0504202180b848e3ece130eb7
7
- data.tar.gz: 3a578661ba3403a7d011f2e7450918b9f35f16896d43fc46ed6b6d3c05dfd81ca7b8c2dd689d879e26276049f4e9b40a4bed7809ece78acb97bb9e161a6e8fcf
6
+ metadata.gz: 86385fed2b4df550bcc6591d098792c7f553b7060fcec9fb8bc9f7b9d8e55b42c06a512139e2f00d4a1089401ada5147964f4b7686e3768b70afcfbc9e1fe9ab
7
+ data.tar.gz: '05774981f87c6733716c58ab8bef597f31aa9a532755a29a31a6df6bb20141afcea87055256202a7a3076633f2f0a2b8428862024cc5f4c07cfe07c242353128'
data/.rubocop.yml CHANGED
@@ -100,3 +100,6 @@ Style/SingleLineBlockParams:
100
100
 
101
101
  Style/SymbolProc:
102
102
  Enabled: false
103
+
104
+ RSpec/ExampleLength:
105
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-g2 (1.5.2)
4
+ rubocop-g2 (1.5.3)
5
5
  rubocop (>= 0.82)
6
6
  rubocop-rails (>= 2.5)
7
7
  rubocop-rspec (>= 1.39)
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.0.0)
12
+ activesupport (7.0.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
@@ -2,7 +2,10 @@ module RuboCop
2
2
  module Cop
3
3
  module G2
4
4
  class BanSidekiqWorker < RuboCop::Cop::Cop
5
+ extend AutoCorrector
6
+
5
7
  MSG = 'Please use Sidekiq::Job instead of Sidekiq::Worker'.freeze
8
+ RESTRICT_ON_SEND = [:include].freeze
6
9
 
7
10
  def_node_search :sidekiq_worker?, <<~PATTERN
8
11
  (send nil? :include (const (const nil? :Sidekiq) :Worker))
@@ -12,6 +15,12 @@ module RuboCop
12
15
  return unless sidekiq_worker?(node)
13
16
  add_offense(node, location: :expression)
14
17
  end
18
+
19
+ def autocorrect(node)
20
+ lambda do |corrector|
21
+ corrector.replace(node, node.source.gsub('Worker', 'Job'))
22
+ end
23
+ end
15
24
  end
16
25
  end
17
26
  end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module G2
3
- VERSION = '1.5.2'.freeze
3
+ VERSION = '1.5.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-g2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Mannino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-04 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop