rubocop-g2 1.4.0 → 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: 1db6fe3ca651f25244c105904e3ade2aa59d66e03ad9af7c723346bebc8ec3ec
4
- data.tar.gz: f59831bc819a38dd8732de5784d217bc141aff96f7648634a31bf9f298021232
3
+ metadata.gz: 07120a37fec4e4375c0e79528fa84951f73db52ccc8aad39839cb050c4c095da
4
+ data.tar.gz: 6ccd769129160321ce8b097427ce4a39319ab9d6787910f319762e54e08f0587
5
5
  SHA512:
6
- metadata.gz: 922b155abca3d15cde8681c1376bc09f62623295196b3928a63377e04614332267782b8ff5b9a3364b1eb8a1a2100d5b25cd34f04bbe71ebf29bd3ae37952fa8
7
- data.tar.gz: a328f94e4da34449f42a5c6fabe800f87e0e905b11c5523f33874af1b2aa5b5e71fa692be8b7be153b4d5bac6c827b138275c973dd62d7f5f0a740b688fb04ef
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/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.2
1
+ ruby 3.0.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-g2 (1.4.0)
4
+ rubocop-g2 (1.5.3)
5
5
  rubocop (>= 0.82)
6
6
  rubocop-rails (>= 2.5)
7
7
  rubocop-rspec (>= 1.39)
@@ -9,22 +9,21 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.4)
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)
16
16
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
17
  ast (2.4.2)
19
18
  coderay (1.1.2)
20
19
  concurrent-ruby (1.1.9)
21
20
  diff-lcs (1.3)
22
- i18n (1.8.10)
21
+ i18n (1.8.11)
23
22
  concurrent-ruby (~> 1.0)
24
23
  method_source (0.9.2)
25
- minitest (5.14.4)
26
- parallel (1.20.0)
27
- parser (3.0.1.1)
24
+ minitest (5.15.0)
25
+ parallel (1.21.0)
26
+ parser (3.1.0.0)
28
27
  ast (~> 2.4.1)
29
28
  pry (0.12.2)
30
29
  coderay (~> 1.1.0)
@@ -32,7 +31,7 @@ GEM
32
31
  rack (2.2.3)
33
32
  rainbow (3.0.0)
34
33
  rake (12.3.3)
35
- regexp_parser (2.0.3)
34
+ regexp_parser (2.2.0)
36
35
  rexml (3.2.5)
37
36
  rspec (3.8.0)
38
37
  rspec-core (~> 3.8.0)
@@ -47,29 +46,27 @@ GEM
47
46
  diff-lcs (>= 1.2.0, < 2.0)
48
47
  rspec-support (~> 3.8.0)
49
48
  rspec-support (3.8.3)
50
- rubocop (1.18.3)
49
+ rubocop (1.24.1)
51
50
  parallel (~> 1.10)
52
51
  parser (>= 3.0.0.0)
53
52
  rainbow (>= 2.2.2, < 4.0)
54
53
  regexp_parser (>= 1.8, < 3.0)
55
54
  rexml
56
- rubocop-ast (>= 1.7.0, < 2.0)
55
+ rubocop-ast (>= 1.15.1, < 2.0)
57
56
  ruby-progressbar (~> 1.7)
58
57
  unicode-display_width (>= 1.4.0, < 3.0)
59
- rubocop-ast (1.8.0)
58
+ rubocop-ast (1.15.1)
60
59
  parser (>= 3.0.1.1)
61
- rubocop-rails (2.8.1)
60
+ rubocop-rails (2.13.0)
62
61
  activesupport (>= 4.2.0)
63
62
  rack (>= 1.1)
64
- rubocop (>= 0.87.0)
65
- rubocop-rspec (2.0.0)
66
- rubocop (~> 1.0)
67
- rubocop-ast (>= 1.1.0)
68
- ruby-progressbar (1.10.1)
63
+ rubocop (>= 1.7.0, < 2.0)
64
+ rubocop-rspec (2.7.0)
65
+ rubocop (~> 1.19)
66
+ ruby-progressbar (1.11.0)
69
67
  tzinfo (2.0.4)
70
68
  concurrent-ruby (~> 1.0)
71
- unicode-display_width (1.7.0)
72
- zeitwerk (2.4.2)
69
+ unicode-display_width (2.1.0)
73
70
 
74
71
  PLATFORMS
75
72
  ruby
@@ -82,4 +79,4 @@ DEPENDENCIES
82
79
  rubocop-g2!
83
80
 
84
81
  BUNDLED WITH
85
- 2.2.23
82
+ 2.2.32
@@ -1,10 +1,12 @@
1
- RSpec:
2
- Include:
3
- - '_spec.rb$'
4
-
5
1
  Lint/Void:
6
2
  Enabled: false
7
3
 
4
+ RSpec:
5
+ Language:
6
+ Includes:
7
+ Examples:
8
+ - include_tests
9
+
8
10
  RSpec/LetSetup:
9
11
  Enabled: false
10
12
 
@@ -0,0 +1,27 @@
1
+ module RuboCop
2
+ module Cop
3
+ module G2
4
+ class BanSidekiqWorker < RuboCop::Cop::Cop
5
+ extend AutoCorrector
6
+
7
+ MSG = 'Please use Sidekiq::Job instead of Sidekiq::Worker'.freeze
8
+ RESTRICT_ON_SEND = [:include].freeze
9
+
10
+ def_node_search :sidekiq_worker?, <<~PATTERN
11
+ (send nil? :include (const (const nil? :Sidekiq) :Worker))
12
+ PATTERN
13
+
14
+ def on_send(node)
15
+ return unless sidekiq_worker?(node)
16
+ add_offense(node, location: :expression)
17
+ end
18
+
19
+ def autocorrect(node)
20
+ lambda do |corrector|
21
+ corrector.replace(node, node.source.gsub('Worker', 'Job'))
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module G2
3
- VERSION = '1.4.0'.freeze
3
+ VERSION = '1.5.3'.freeze
4
4
  end
5
5
  end
data/lib/rubocop_g2.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubocop'
2
2
 
3
3
  require_relative 'rubocop/g2/version'
4
4
  require_relative 'rubocop/cop/g2/ban_decorators'
5
+ require_relative 'rubocop/cop/g2/ban_sidekiq_worker'
5
6
  require_relative 'rubocop/cop/g2/predicate_memoization'
6
7
  require_relative 'rubocop/cop/g2/raw_connection_execute'
7
8
  require_relative 'rubocop/cop/g2/aggregates_model_boundary'
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.4.0
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: 2021-07-14 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
@@ -129,6 +129,7 @@ files:
129
129
  - lib/rubocop/cop/g2/accessible_icons.rb
130
130
  - lib/rubocop/cop/g2/aggregates_model_boundary.rb
131
131
  - lib/rubocop/cop/g2/ban_decorators.rb
132
+ - lib/rubocop/cop/g2/ban_sidekiq_worker.rb
132
133
  - lib/rubocop/cop/g2/predicate_memoization.rb
133
134
  - lib/rubocop/cop/g2/raw_connection_execute.rb
134
135
  - lib/rubocop/g2/version.rb
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0'
154
155
  requirements: []
155
- rubygems_version: 3.1.4
156
+ rubygems_version: 3.2.32
156
157
  signing_key:
157
158
  specification_version: 4
158
159
  summary: Custom cops for G2.