rubocop-nueca 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e2e8263941b4c5f0934ad7fb9f8df991e90583476f10fc3290a3c7dd2f917ff
4
- data.tar.gz: 0e503986f5bfd5003b40beee3844cfeb9ae5cdc179b2d4576d139e1d244ba18f
3
+ metadata.gz: ec8137f1dc94ea82c488b598bef4742c1274123b950f1b31d407c05f9a62a657
4
+ data.tar.gz: 6e63b2765a397fdd83d6cc275bd5b54a6ae9e728e7482df01ae0502dc1b0efdb
5
5
  SHA512:
6
- metadata.gz: dc56766f7ecaa64cb93001e8ee3cd4eca0250bbf4b509d41f2fb6bcbe36d3d30e1d34dba4bdcdbcd26a4f8cd143600000364c5b9ad184793b99bc24f3992373e
7
- data.tar.gz: 1e89c75c3f19fea9dc29979dd38af0695f4ea4e77f126e7d3d0bc407853f2a3e61baef1f9862016101ee280775bf4ca0c1a24f5cac2f1a48c4418d8cb4c03f05
6
+ metadata.gz: ad1cc7f722ca78c9611e34a749b16389d2385f95f9819314655f9a7d683f045d5a8606a0a4e01d8db8131b24d88c2658f59f92d15c30f4fd67d2e9fea348765f
7
+ data.tar.gz: 8c84dd737a4d078510f196274065192b55262470e9299ee4d3131991c9058e57fcd04dd418f1332c49bd73232ca0d7132e80eb37c72ea2c92d104093d5a7ff1e
data/config/default.yml CHANGED
@@ -30,14 +30,14 @@ Metrics/ClassLength:
30
30
  CountComments: false
31
31
  CountAsOne: [array, hash, heredoc, method_call]
32
32
  Exclude:
33
- - 'db/migrate/**/*'
33
+ - 'db/*migrate/**/*'
34
34
 
35
35
  Metrics/MethodLength:
36
36
  Max: 20
37
37
  CountComments: false
38
38
  CountAsOne: [array, hash, heredoc, method_call]
39
39
  Exclude:
40
- - 'db/migrate/**/*'
40
+ - 'db/*migrate/**/*'
41
41
 
42
42
  Metrics/ModuleLength:
43
43
  CountComments: false
@@ -191,3 +191,7 @@ Style/TopLevelMethodDefinition:
191
191
  Style/TrailingCommaInBlockArgs:
192
192
  Enabled: true
193
193
  EnforcedStyleForMultiline: no_comma
194
+
195
+ RSpec/ExpectInHook:
196
+ Exclude:
197
+ - 'spec/features/**/*_spec.rb'
@@ -93,8 +93,7 @@ module RuboCop
93
93
  end
94
94
 
95
95
  def check_group_sorting(group_associations)
96
- through_associations = group_associations.select { |assoc| assoc[:through] }
97
- regular_associations = group_associations.reject { |assoc| assoc[:through] }
96
+ through_associations, regular_associations = group_associations.partition { |assoc| assoc[:through] }
98
97
 
99
98
  regular_sorted = regular_associations.sort_by { |assoc| assoc[:name] }
100
99
 
@@ -118,11 +117,11 @@ module RuboCop
118
117
  end
119
118
 
120
119
  def build_association_lookup(associations)
121
- associations.each_with_object({}) { |assoc, lookup| lookup[assoc[:name]] = assoc } # rubocop:disable Rails/IndexBy
120
+ associations.to_h { |assoc| [assoc[:name], assoc] } # rubocop:disable Rails/IndexBy
122
121
  end
123
122
 
124
123
  def build_dependency_graph(associations, lookup)
125
- graph = associations.each_with_object({}) { |assoc, deps| deps[assoc[:name]] = [] }
124
+ graph = associations.to_h { |assoc| [assoc[:name], []] }
126
125
 
127
126
  associations.each do |assoc|
128
127
  graph[assoc[:through]] << assoc[:name] if assoc[:through] && lookup[assoc[:through]]
@@ -147,7 +146,7 @@ module RuboCop
147
146
  end
148
147
 
149
148
  def calculate_in_degrees(dependency_graph, all_nodes)
150
- in_degrees = all_nodes.each_with_object({}) { |node, degrees| degrees[node] = 0 }
149
+ in_degrees = all_nodes.to_h { |node| [node, 0] }
151
150
 
152
151
  dependency_graph.each_value do |dependents|
153
152
  dependents.each { |dependent| in_degrees[dependent] += 1 }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Nueca
5
- VERSION = '2.2.0'
5
+ VERSION = '2.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-nueca
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tien