carwow_rubocop 4.0.0 → 4.0.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: 7e205e4968385dd33b555dbe38d9de54acd6a3aa2a666a893f9e72e9ace3489c
4
- data.tar.gz: ad4268b23619062ad1cb11840478b774e52dc0dedd823773a617fb97c8bd82a4
3
+ metadata.gz: a298086f7e65b0263cc91fe3c8d074132c26d85080f7d6005d9ff93be25b5d4f
4
+ data.tar.gz: f4b3524c0cb7e68ada8939cb9f7e62cfc2a1eab9c7dd48e7d2934038b167c78d
5
5
  SHA512:
6
- metadata.gz: 6fee3a916cea0cd78637e7113d67432e0ae00e11358f172bfe2812e3c399c75cd438ec750c7365e099ce50030635dacf517a1b6158e84fe4f057f8eb2c28a637
7
- data.tar.gz: 77df54899aff739a4fe8d3fae0759caabc3b92d6d33481874183efd436404d76e2427b968080d060c8982908142f59d2dcfb4d106098368ffd8bb328f9984987
6
+ metadata.gz: 8479fd94ca36b4f1afa7f5628dea506e6a51fbd28200b15e6f5d04328dea4bf451de345989a10572bb3e137d960e251e160a6a04702aa2b833cbb00ee1e83009
7
+ data.tar.gz: 027405a2b9112e32bc4e87977b5ba87289ce57fd2b25cb7edcb11ebf2c9b8dd50bc512a3b2989201fb89c17f09045acb66a838dab09abc03e27c12e9ef596c71
data/.circleci/config.yml CHANGED
@@ -22,7 +22,7 @@ jobs:
22
22
  - run:
23
23
  name: Running gem tests
24
24
  command: |
25
- bundle exec rake
25
+ bundle exec rspec
26
26
 
27
27
 
28
28
  lint_ruby:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carwow_rubocop (4.0.0)
4
+ carwow_rubocop (4.0.1)
5
5
  rubocop (>= 0.93)
6
6
  rubocop-performance
7
7
  rubocop-rspec
@@ -36,7 +36,7 @@ GEM
36
36
  diff-lcs (>= 1.2.0, < 2.0)
37
37
  rspec-support (~> 3.10.0)
38
38
  rspec-support (3.10.2)
39
- rubocop (1.22.1)
39
+ rubocop (1.22.3)
40
40
  parallel (~> 1.10)
41
41
  parser (>= 3.0.0.0)
42
42
  rainbow (>= 2.2.2, < 4.0)
@@ -45,12 +45,12 @@ GEM
45
45
  rubocop-ast (>= 1.12.0, < 2.0)
46
46
  ruby-progressbar (~> 1.7)
47
47
  unicode-display_width (>= 1.4.0, < 3.0)
48
- rubocop-ast (1.12.0)
48
+ rubocop-ast (1.13.0)
49
49
  parser (>= 3.0.1.1)
50
- rubocop-performance (1.11.5)
50
+ rubocop-performance (1.12.0)
51
51
  rubocop (>= 1.7.0, < 2.0)
52
52
  rubocop-ast (>= 0.4.0)
53
- rubocop-rspec (2.5.0)
53
+ rubocop-rspec (2.6.0)
54
54
  rubocop (~> 1.19)
55
55
  ruby-progressbar (1.11.0)
56
56
  unicode-display_width (2.1.0)
data/README.md CHANGED
@@ -31,7 +31,7 @@ First Create a new file `.rubocop_carwow.yml` in the same directory as your `.ru
31
31
  this file should contain
32
32
 
33
33
  require:
34
- - rubocop-carwow
34
+ - carwow_rubocop
35
35
 
36
36
  Next add the following to `.rubocop.yml`
37
37
  or add before `.rubocop_todo.yml` in your existing `inherit_from`
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module Carwow
3
- VERSION = '4.0.0'.freeze
3
+ VERSION = '4.0.1'.freeze
4
4
  end
5
5
  end
@@ -55,7 +55,7 @@ module RuboCop
55
55
  def on_class(node)
56
56
  return add_global_offense(NOT_CONFIGURED) if missing_config?
57
57
 
58
- return if allowed?(super_class(*node))
58
+ return if any_ancestor_allowed?(node)
59
59
  return if defining_allowed_job?(*node)
60
60
 
61
61
  register_offenses(node)
@@ -63,6 +63,13 @@ module RuboCop
63
63
 
64
64
  private
65
65
 
66
+ def any_ancestor_allowed?(class_node)
67
+ root_node = class_node.root? ? class_node : class_node.ancestors.last
68
+ root_node.each_descendant(:class).any? do |node|
69
+ allowed?(super_class(*node))
70
+ end
71
+ end
72
+
66
73
  def allowed?(superclass)
67
74
  cop_config.fetch('AllowedSuperclasses').include?(superclass)
68
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carwow_rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-20 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.1.6
171
+ rubygems_version: 3.1.4
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: carwow's rubocop configuration