betterlint 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/betterment/hardcoded_id.rb +1 -1
- data/lib/rubocop/cop/betterment/site_prism_loaded.rb +2 -2
- data/lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb +1 -1
- data/lib/rubocop/cop/betterment/vague_serialize.rb +21 -0
- data/lib/rubocop/cop/betterment.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e93a2bacb559d6455d9e1d7acf0ee3d34e378817b70ff2694d9c7dc5fd051c7
|
4
|
+
data.tar.gz: 8613c5d928bfa812f75e6092ddb201d7030cee8e9c27ded059487941628a6540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc6e12bc99a8405a25f0902636087ef2f034641f161465c3b337f08ade4a916d3a92b6ec8a4e259afea53aebefe4068214dd2b3faf5bbf0473a4b3617289154
|
7
|
+
data.tar.gz: c8e15b4f85363fb9ade768e1e012b717a58e168040500639b053fd831a48133174ae67c33cd25229ea8eff885ac90b5228c0c4113be01e411f3f8f92fed35fb6
|
@@ -11,12 +11,12 @@ module RuboCop
|
|
11
11
|
def on_send(node)
|
12
12
|
return unless be_displayed_call?(node)
|
13
13
|
|
14
|
-
add_offense(node, location: node.children[2].
|
14
|
+
add_offense(node, location: node.children[2].source_range)
|
15
15
|
end
|
16
16
|
|
17
17
|
def autocorrect(node)
|
18
18
|
lambda do |corrector|
|
19
|
-
corrector.replace(node.children[2].
|
19
|
+
corrector.replace(node.children[2].source_range, 'be_loaded')
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -41,7 +41,7 @@ module RuboCop
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def create_range(node, match)
|
44
|
-
range = node.
|
44
|
+
range = node.source_range
|
45
45
|
begin_pos = range.begin_pos + match.begin(0)
|
46
46
|
end_pos = range.begin_pos + match.end(0)
|
47
47
|
range.with(begin_pos: begin_pos, end_pos: end_pos)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module RuboCop
|
2
|
+
module Cop
|
3
|
+
module Betterment
|
4
|
+
class VagueSerialize < Base
|
5
|
+
MSG = 'Active Record models with serialized columns should specify which ' \
|
6
|
+
'deserializer to use instead of falling back to the default.'.freeze
|
7
|
+
|
8
|
+
# @!method serialize?(node)
|
9
|
+
def_node_matcher :serialize?, <<-PATTERN
|
10
|
+
(send nil? :serialize ...)
|
11
|
+
PATTERN
|
12
|
+
|
13
|
+
def on_send(node)
|
14
|
+
return unless serialize? node
|
15
|
+
|
16
|
+
add_offense(node) if node.arguments.length < 2 || !node.arguments[1].const_type?
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -16,3 +16,4 @@ require 'rubocop/cop/betterment/active_job_performable'
|
|
16
16
|
require 'rubocop/cop/betterment/allowlist_blocklist'
|
17
17
|
require 'rubocop/cop/betterment/server_error_assertion'
|
18
18
|
require 'rubocop/cop/betterment/hardcoded_id'
|
19
|
+
require 'rubocop/cop/betterment/vague_serialize'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betterlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Development
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.7'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.7'
|
83
83
|
description: Betterment rubocop configuration
|
84
84
|
email:
|
85
85
|
- development@betterment.com
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/rubocop/cop/betterment/utils/hardcoded_attribute.rb
|
109
109
|
- lib/rubocop/cop/betterment/utils/method_return_table.rb
|
110
110
|
- lib/rubocop/cop/betterment/utils/parser.rb
|
111
|
+
- lib/rubocop/cop/betterment/vague_serialize.rb
|
111
112
|
homepage:
|
112
113
|
licenses:
|
113
114
|
- MIT
|
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
- !ruby/object:Gem::Version
|
129
130
|
version: '0'
|
130
131
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.2.32
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: Betterment rubocop configuration
|