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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 319d9ad3cd53f54122dd36a4d53d4ba2b1e496831c3c26022b2a8494f5a95fdc
4
- data.tar.gz: b54dd12e0177a48827cb87f35fa6af902e256f996c96a990933c08c22e8b91f5
3
+ metadata.gz: db281c40f5207dfc9759c52c60d4e2799d772e8d612364c4afa9b72eb935c90a
4
+ data.tar.gz: f84b8ca1a7d8cdb598c170b9c04b98b2358750ced29a8d3b3fb011b8a629449c
5
5
  SHA512:
6
- metadata.gz: 07d68c578fa6807867b0caa213706484ff8c04475e1f17ce0f3121a37307f0cb48962a1ee7c1782dcbaedbff34748a075a41522e8d9c79dcdf24e9d4b8aa581a
7
- data.tar.gz: e47791134b21b41a4d9fcae6503db43cefb2d377391b7e3c5a7537bd5944fecd444164931df15035d628b939ce6fe5e6fac50694aef76c856c66c3a97763b04a
6
+ metadata.gz: 4597d82f8b5dd02a575d4720c10f495e6ebf16bfe47ef88c9557e5cb474c83bc35505861e2a1e5fdbc3b1d062fac6a06d3cfe94a05593ee9638a0aecf1034125
7
+ data.tar.gz: 3e9c4206cec1f67a0ab9176814f4405fe6d7fbe83c8571d0759788206b67569a8ad144f0cb934dbc2ddf30df29d529906f7160c5b029fbc13a60464229f2a8d6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.5.1 - 2022-06-28
6
+
7
+ ### Fixed
8
+
9
+ - Fix `Sevencop/BelongsToOptional` scope bug.
10
+
5
11
  ## 0.5.0 - 2022-06-27
6
12
 
7
13
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.5.0)
4
+ sevencop (0.5.1)
5
5
  rubocop
6
6
 
7
7
  GEM
@@ -53,4 +53,4 @@ DEPENDENCIES
53
53
  sevencop!
54
54
 
55
55
  BUNDLED WITH
56
- 2.3.6
56
+ 2.3.16
@@ -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
- if node.arguments[-1].hash_type?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
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.0
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.2.32
75
+ rubygems_version: 3.3.7
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Custom cops for RuboCop.