rubocop-g2 1.5.3 → 1.6.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: 07120a37fec4e4375c0e79528fa84951f73db52ccc8aad39839cb050c4c095da
4
- data.tar.gz: 6ccd769129160321ce8b097427ce4a39319ab9d6787910f319762e54e08f0587
3
+ metadata.gz: 78336eed3c07bfeec4e0b69c5aff3c25afe16a829a7189ed845d324ffbf1e000
4
+ data.tar.gz: ec8ba26224f063994a158ef7924c124e08146bebc79908f83499e3e20b07c14f
5
5
  SHA512:
6
- metadata.gz: 86385fed2b4df550bcc6591d098792c7f553b7060fcec9fb8bc9f7b9d8e55b42c06a512139e2f00d4a1089401ada5147964f4b7686e3768b70afcfbc9e1fe9ab
7
- data.tar.gz: '05774981f87c6733716c58ab8bef597f31aa9a532755a29a31a6df6bb20141afcea87055256202a7a3076633f2f0a2b8428862024cc5f4c07cfe07c242353128'
6
+ metadata.gz: 341ea0af56943e1029e7909a382f1da8ff2a332ca8c7d62a39cca6c631aa73c0ce5de58a85c7f5e0f7ac26e9964c4c02f24fa53249b1c7def23f71c3525cc54b
7
+ data.tar.gz: 3ec4fe034ba044d66d9796cefedc31dbad4eadca4476ab4f2cf819dac6edcab4f8c78470d2b7300669fe5aff84de5c71a81dcfbb9718e17ac285f9131665e3b4
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.0.3
1
+ ruby 3.1.1
data/Gemfile.lock CHANGED
@@ -79,4 +79,4 @@ DEPENDENCIES
79
79
  rubocop-g2!
80
80
 
81
81
  BUNDLED WITH
82
- 2.2.32
82
+ 2.3.10
@@ -0,0 +1,18 @@
1
+ module RuboCop
2
+ module Cop
3
+ module G2
4
+ class SafeConnectionHandling < RuboCop::Cop::Cop
5
+ MSG = 'ActiveRecord::Base should only be used to create an ApplicationRecord subclass.'.freeze
6
+
7
+ def_node_matcher :safe_base_class?, <<~PATTERN
8
+ (send (const (const nil? :ActiveRecord) :Base) ...)
9
+ PATTERN
10
+
11
+ def on_send(node)
12
+ return unless safe_base_class?(node)
13
+ add_offense(node)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module G2
3
- VERSION = '1.5.3'.freeze
3
+ VERSION = '1.6.0'.freeze
4
4
  end
5
5
  end
data/lib/rubocop_g2.rb CHANGED
@@ -5,5 +5,6 @@ require_relative 'rubocop/cop/g2/ban_decorators'
5
5
  require_relative 'rubocop/cop/g2/ban_sidekiq_worker'
6
6
  require_relative 'rubocop/cop/g2/predicate_memoization'
7
7
  require_relative 'rubocop/cop/g2/raw_connection_execute'
8
+ require_relative 'rubocop/cop/g2/safe_connection_handling'
8
9
  require_relative 'rubocop/cop/g2/aggregates_model_boundary'
9
10
  require_relative 'rubocop/cop/g2/accessible_icons'
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.3
4
+ version: 1.6.0
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-08 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -132,6 +132,7 @@ files:
132
132
  - lib/rubocop/cop/g2/ban_sidekiq_worker.rb
133
133
  - lib/rubocop/cop/g2/predicate_memoization.rb
134
134
  - lib/rubocop/cop/g2/raw_connection_execute.rb
135
+ - lib/rubocop/cop/g2/safe_connection_handling.rb
135
136
  - lib/rubocop/g2/version.rb
136
137
  - lib/rubocop_g2.rb
137
138
  - rubocop-g2.gemspec
@@ -153,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
154
  - !ruby/object:Gem::Version
154
155
  version: '0'
155
156
  requirements: []
156
- rubygems_version: 3.2.32
157
+ rubygems_version: 3.3.7
157
158
  signing_key:
158
159
  specification_version: 4
159
160
  summary: Custom cops for G2.