sevencop 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +2 -2
- data/lib/rubocop/cop/sevencop/belongs_to_optional.rb +4 -8
- data/lib/sevencop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db281c40f5207dfc9759c52c60d4e2799d772e8d612364c4afa9b72eb935c90a
|
4
|
+
data.tar.gz: f84b8ca1a7d8cdb598c170b9c04b98b2358750ced29a8d3b3fb011b8a629449c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4597d82f8b5dd02a575d4720c10f495e6ebf16bfe47ef88c9557e5cb474c83bc35505861e2a1e5fdbc3b1d062fac6a06d3cfe94a05593ee9638a0aecf1034125
|
7
|
+
data.tar.gz: 3e9c4206cec1f67a0ab9176814f4405fe6d7fbe83c8571d0759788206b67569a8ad144f0cb934dbc2ddf30df29d529906f7160c5b029fbc13a60464229f2a8d6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -29,15 +29,15 @@ module RuboCop
|
|
29
29
|
].freeze
|
30
30
|
|
31
31
|
def_node_matcher :without_options?, <<~PATTERN
|
32
|
-
(send _ _ _)
|
32
|
+
(send _ _ _ (block ...)?)
|
33
33
|
PATTERN
|
34
34
|
|
35
35
|
def_node_matcher :with_hash_options?, <<~PATTERN
|
36
|
-
(send _ _ _ (hash ...))
|
36
|
+
(send _ _ _ (block ...)? (hash ...))
|
37
37
|
PATTERN
|
38
38
|
|
39
39
|
def_node_matcher :with_optional?, <<~PATTERN
|
40
|
-
(send _ _ _ (hash <(pair (sym :optional) _) ...>))
|
40
|
+
(send _ _ _ (block ...)? (hash <(pair (sym :optional) _) ...>))
|
41
41
|
PATTERN
|
42
42
|
|
43
43
|
# @param [RuboCop::AST::SendNode] node
|
@@ -45,11 +45,7 @@ module RuboCop
|
|
45
45
|
return unless without_options?(node) || (with_hash_options?(node) && !with_optional?(node))
|
46
46
|
|
47
47
|
add_offense(node) do |corrector|
|
48
|
-
|
49
|
-
corrector.insert_after(node.arguments[-1], ', optional: true')
|
50
|
-
elsif node.arguments.length == 1
|
51
|
-
corrector.insert_after(node.arguments.first, ', optional: true')
|
52
|
-
end
|
48
|
+
corrector.insert_after(node.arguments[-1], ', optional: true')
|
53
49
|
end
|
54
50
|
end
|
55
51
|
end
|
data/lib/sevencop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sevencop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.3.7
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Custom cops for RuboCop.
|