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 +4 -4
- data/.tool-versions +1 -1
- data/Gemfile.lock +1 -1
- data/lib/rubocop/cop/g2/safe_connection_handling.rb +18 -0
- data/lib/rubocop/g2/version.rb +1 -1
- data/lib/rubocop_g2.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78336eed3c07bfeec4e0b69c5aff3c25afe16a829a7189ed845d324ffbf1e000
|
4
|
+
data.tar.gz: ec8ba26224f063994a158ef7924c124e08146bebc79908f83499e3e20b07c14f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 341ea0af56943e1029e7909a382f1da8ff2a332ca8c7d62a39cca6c631aa73c0ce5de58a85c7f5e0f7ac26e9964c4c02f24fa53249b1c7def23f71c3525cc54b
|
7
|
+
data.tar.gz: 3ec4fe034ba044d66d9796cefedc31dbad4eadca4476ab4f2cf819dac6edcab4f8c78470d2b7300669fe5aff84de5c71a81dcfbb9718e17ac285f9131665e3b4
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 3.
|
1
|
+
ruby 3.1.1
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/rubocop/g2/version.rb
CHANGED
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.
|
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-
|
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.
|
157
|
+
rubygems_version: 3.3.7
|
157
158
|
signing_key:
|
158
159
|
specification_version: 4
|
159
160
|
summary: Custom cops for G2.
|