armitage-rubocop 1.3.1.1 → 1.6.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: 6b53318fc5d75e3b7f804776a311944fe23127642126a1392b2fb2fc81d815ff
4
- data.tar.gz: 99e48a94c3ec1a265623deebc79c25ecd7660ed818ad81054686fcb700b5beb7
3
+ metadata.gz: b300bd4a0d4d7b01a9c2249f1e8fb83ce5fbdcbc1925c056eecbdba03a6205b3
4
+ data.tar.gz: 58451e1b8322fec8e993db5639c2d60bfb9b1eaa77c47c724af349baec061536
5
5
  SHA512:
6
- metadata.gz: abe8fad07125c511a9e427e92823bc41e36b703248b043fe5f98ca4a9156398a7bee675149f4a9505716115c3e32d9b7a34a22704ee70f89b193e860a6ed08d4
7
- data.tar.gz: e119e27885f140e993982b1739bcb753721ec2e50a8027994eb99a65247311ea0b34b153174198134e430153e5f23a338c42e6c7035eb5411634bcc5fbf00089
6
+ metadata.gz: 70ed42502211016d45dfbd6b890daa0a2187faef42bd29aeaf81dc2e66686d12499718469e3da1fb6ad07581b8469ea02e956d09a92fed76bebe5fcda53f3750
7
+ data.tar.gz: 254883a9930ff28b65f88fb7ec025c3ea1c686be70e41385d002ebb950408fc091777a736ac905d64b3ae2e85568e45c122be4a39cd35faa0b1da815b3f8fe91
data/.gitignore CHANGED
@@ -7,7 +7,6 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  .rspec_status
10
- /Gemfile.lock
11
10
  .ruby-version
12
11
  gemfiles/*.lock
13
12
  *.gem
@@ -0,0 +1,78 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ armitage-rubocop (1.6.1)
5
+ rubocop (= 1.6.1)
6
+ rubocop-performance (= 1.9.1)
7
+ rubocop-rails (= 2.9.0)
8
+ rubocop-rake (= 0.5.1)
9
+ rubocop-rspec (= 2.0.1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (6.1.0)
15
+ concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ tzinfo (~> 2.0)
19
+ zeitwerk (~> 2.3)
20
+ ast (2.4.1)
21
+ coderay (1.1.3)
22
+ concurrent-ruby (1.1.7)
23
+ i18n (1.8.5)
24
+ concurrent-ruby (~> 1.0)
25
+ method_source (1.0.0)
26
+ minitest (5.14.2)
27
+ parallel (1.20.1)
28
+ parser (2.7.2.0)
29
+ ast (~> 2.4.1)
30
+ pry (0.13.1)
31
+ coderay (~> 1.1)
32
+ method_source (~> 1.0)
33
+ rack (2.2.3)
34
+ rainbow (3.0.0)
35
+ rake (13.0.1)
36
+ regexp_parser (2.0.0)
37
+ rexml (3.2.4)
38
+ rubocop (1.6.1)
39
+ parallel (~> 1.10)
40
+ parser (>= 2.7.1.5)
41
+ rainbow (>= 2.2.2, < 4.0)
42
+ regexp_parser (>= 1.8, < 3.0)
43
+ rexml
44
+ rubocop-ast (>= 1.2.0, < 2.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 1.4.0, < 2.0)
47
+ rubocop-ast (1.3.0)
48
+ parser (>= 2.7.1.5)
49
+ rubocop-performance (1.9.1)
50
+ rubocop (>= 0.90.0, < 2.0)
51
+ rubocop-ast (>= 0.4.0)
52
+ rubocop-rails (2.9.0)
53
+ activesupport (>= 4.2.0)
54
+ rack (>= 1.1)
55
+ rubocop (>= 0.90.0, < 2.0)
56
+ rubocop-rake (0.5.1)
57
+ rubocop
58
+ rubocop-rspec (2.0.1)
59
+ rubocop (~> 1.0)
60
+ rubocop-ast (>= 1.1.0)
61
+ ruby-progressbar (1.10.1)
62
+ tzinfo (2.0.3)
63
+ concurrent-ruby (~> 1.0)
64
+ unicode-display_width (1.7.0)
65
+ zeitwerk (2.4.2)
66
+
67
+ PLATFORMS
68
+ ruby
69
+ x86_64-darwin-20
70
+
71
+ DEPENDENCIES
72
+ armitage-rubocop!
73
+ bundler
74
+ pry
75
+ rake
76
+
77
+ BUNDLED WITH
78
+ 2.2.0
data/Rakefile CHANGED
@@ -5,20 +5,21 @@ require 'rubocop/rake_task'
5
5
  require 'open3'
6
6
  require 'yaml'
7
7
  require 'rubocop'
8
+ require 'rubocop-performance'
8
9
  require 'rubocop-rspec'
9
10
  require 'rubocop-rails'
10
- require 'rubocop-performance'
11
11
  require 'rubocop-rake'
12
12
 
13
13
  RuboCop::RakeTask.new(:rubocop) do |t|
14
14
  config_path = File.expand_path(File.join('.rubocop.yml'), __dir__)
15
15
  t.options = ['--config', config_path]
16
- t.requires << 'rubocop-rspec'
17
16
  t.requires << 'rubocop-performance'
18
17
  t.requires << 'rubocop-rails'
18
+ t.requires << 'rubocop-rspec'
19
19
  t.requires << 'rubocop-rake'
20
20
  end
21
21
 
22
+ ARMITAGE_RUBOCOP_PATH = Pathname.new(__FILE__).join('../.rubocop.yml')
22
23
  NON_CHECKABLE_COPS = %w[Rails].freeze # NOTE: Global "Rails" cop has only `Enabled` option
23
24
 
24
25
  # rubocop:disable Rails/RakeEnvironment
@@ -78,58 +79,17 @@ namespace :armitage_rubocop do
78
79
 
79
80
  desc 'Checks that all defined cops can be used'
80
81
  task :recognizable_cops do
81
- yamls = Dir[Pathname.new(__FILE__).join('../lib/**/*.yml')]
82
- invalid_cops = Hash.new { |h, k| h[k] = +'' }
83
-
84
- # NOTE: strongly rubocop-related realization
85
- # - see https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/config.rb
86
- # - see https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/config_loader.rb
87
- # - RuboCop::Config#validate
88
- # - RuboCop::Config#warn_about_unrecognized_cops
89
- # - RuboCop::ConfigLoader.load_file
90
- # - RuboCop::ConfigLoader.default_configuration
91
- yamls.each do |yaml_file|
92
- rubocop_config = RuboCop::ConfigLoader.load_file(yaml_file)
93
-
94
- # NOTE: validate cop existence
95
- rubocop_config.each_key do |cop|
96
- next if RuboCop::ConfigLoader.default_configuration.key?(cop)
97
- next if RuboCop::Cop::Cop.registry.contains_cop_matching?([cop])
98
- next if cop == 'inherit_mode'
99
-
100
- invalid_cops[cop] = "\e[31mBAD COP\e[0m"
101
- end
102
-
103
- # NOTE: validate cop params
104
- rubocop_config.each_key do |cop|
105
- next if invalid_cops.key?(cop)
106
-
107
- invalid_params = Set.new
108
-
109
- rubocop_config[cop].each_key do |cop_param|
110
- next if RuboCop::ConfigValidator::COMMON_PARAMS.include?(cop_param)
111
- next if NON_CHECKABLE_COPS.include?(cop)
112
- next if RuboCop::ConfigLoader.default_configuration[cop].key?(cop_param)
113
-
114
- invalid_params << "\e[35m#{cop_param}\e[0m"
115
- end
116
-
117
- next if invalid_params.empty?
118
-
119
- invalid_cops[cop] = "\e[31mBAD PARAMS\e[0m: #{invalid_params.to_a.join(', ')}"
120
- end
121
- end
122
-
123
- if invalid_cops.empty?
124
- puts "[\e[32mCOP RECOGNITION CHECK\e[0m] => \e[1;33mall cops are recognizable!\e[0m"
125
- else
126
- invalid_cops_message = invalid_cops.each_pair.map do |cop, message|
127
- "[\e[32m#{cop}\e[0m]\t- #{message}"
128
- end.join("\n")
82
+ RuboCop::ConfigLoader.load_file(ARMITAGE_RUBOCOP_PATH)
83
+ # TODO: validate each configured cop individually
84
+ puts "[\e[32mCOP RECOGNITION CHECK\e[0m] => \e[1;33mall cops are recognizable!\e[0m"
85
+ rescue
86
+ abort "[\e[31mCOP RECOGNITION CHECK\e[0m] => some cops can not be fully recognized!\n" \
87
+ "Run rake validation:recognize_and_show to show which cops have incompatabilities."
88
+ end
129
89
 
130
- abort "[\e[31mCOP RECOGNITION CHECK\e[0m] => some cops can not be fully recognized:\n" \
131
- "#{invalid_cops_message}"
132
- end
90
+ desc 'Show rubocop\'s validation result output'
91
+ task :recognize_and_show do
92
+ RuboCop::ConfigLoader.load_file(ARMITAGE_RUBOCOP_PATH) rescue nil
133
93
  end
134
94
  end
135
95
  end
@@ -4,7 +4,7 @@ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.version = '1.3.1.1'
7
+ spec.version = '1.6.1'
8
8
 
9
9
  spec.name = 'armitage-rubocop'
10
10
  spec.license = 'MIT'
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
24
 
25
- spec.add_dependency 'rubocop', '= 1.3.1'
26
- spec.add_dependency 'rubocop-performance', '= 1.9.0'
27
- spec.add_dependency 'rubocop-rails', '= 2.8.1'
28
- spec.add_dependency 'rubocop-rspec', '= 2.0.0'
25
+ spec.add_dependency 'rubocop', '= 1.6.1'
26
+ spec.add_dependency 'rubocop-performance', '= 1.9.1'
27
+ spec.add_dependency 'rubocop-rails', '= 2.9.0'
28
+ spec.add_dependency 'rubocop-rspec', '= 2.0.1'
29
29
  spec.add_dependency 'rubocop-rake', '= 0.5.1'
30
30
 
31
31
  spec.add_development_dependency 'bundler'
@@ -111,6 +111,9 @@ Layout/EmptyLineBetweenDefs:
111
111
  Enabled: true
112
112
  NumberOfEmptyLines: 1
113
113
  AllowAdjacentOneLineDefs: false
114
+ EmptyLineBetweenMethodDefs: true
115
+ EmptyLineBetweenClassDefs: true
116
+ EmptyLineBetweenModuleDefs: true
114
117
 
115
118
  Layout/EmptyLines:
116
119
  Enabled: true
@@ -176,7 +176,7 @@ Lint/MixedRegexpCaptureTypes:
176
176
  # NOTE: if you use named captures - numbered captures will be ignored. it is bad. validate it.
177
177
 
178
178
  Lint/MissingSuper:
179
- Enabled: false
179
+ Enabled: true
180
180
 
181
181
  Lint/MultipleComparison:
182
182
  Enabled: true
@@ -301,6 +301,9 @@ Lint/TopLevelReturnWithArgument:
301
301
  Lint/TrailingCommaInAttributeDeclaration:
302
302
  Enabled: true
303
303
 
304
+ Lint/UnexpectedBlockArity:
305
+ Enabled: false
306
+
304
307
  Lint/UnderscorePrefixedVariableName:
305
308
  Enabled: false
306
309
 
@@ -1,13 +1,16 @@
1
1
  Metrics/AbcSize:
2
2
  Enabled: true
3
3
  Max: 19
4
+ CountRepeatedAttributes: true
4
5
  IgnoredMethods: []
5
6
 
6
7
  Metrics/BlockLength:
7
8
  Enabled: true
8
9
  CountComments: false
10
+ CountAsOne: []
9
11
  Max: 25
10
- ExcludedMethods: []
12
+ IgnoredMethods:
13
+ - refine
11
14
  Exclude:
12
15
  - Rakefile
13
16
  - spec/**/*
@@ -32,6 +35,8 @@ Metrics/MethodLength:
32
35
  Enabled: true
33
36
  Max: 25
34
37
  CountComments: false
38
+ CountAsOne: []
39
+ IgnoredMethods: []
35
40
 
36
41
  Metrics/ModuleLength:
37
42
  Enabled: true
@@ -41,6 +46,7 @@ Metrics/ModuleLength:
41
46
  Metrics/ParameterLists:
42
47
  Enabled: true
43
48
  Max: 5
49
+ MaxOptionalParameters: 3
44
50
  CountKeywordArgs: true
45
51
 
46
52
  Metrics/PerceivedComplexity:
@@ -1,5 +1,5 @@
1
1
  Performance/ArraySemiInfiniteRangeSlice:
2
- Enabled: true
2
+ Enabled: false
3
3
 
4
4
  Performance/AncestorsInclude:
5
5
  Enabled: true
@@ -33,6 +33,12 @@ Rails/ApplicationController:
33
33
  Rails/ApplicationMailer:
34
34
  Enabled: false
35
35
 
36
+ Rails/AttributeDefaultBlockValue:
37
+ Enabled: true
38
+
39
+ Rails/ArelStar:
40
+ Enabled: true
41
+
36
42
  Rails/RakeEnvironment:
37
43
  Enabled: true
38
44
  AutoCorrect: true
@@ -271,6 +277,9 @@ Rails/UnknownEnv:
271
277
  Rails/Validation:
272
278
  Enabled: true
273
279
 
280
+ Rails/WhereEquals:
281
+ Enabled: true
282
+
274
283
  Rails/WhereExists:
275
284
  Enabled: false
276
285
  EnforcedStyle: exists
@@ -466,6 +466,9 @@ Style/RaiseArgs:
466
466
  Style/RandomWithOffset:
467
467
  Enabled: true
468
468
 
469
+ Style/RedundantArgument:
470
+ Enabled: false
471
+
469
472
  Style/RedundantAssignment:
470
473
  Enabled: true
471
474
 
@@ -669,6 +672,7 @@ Style/RedundantSort:
669
672
 
670
673
  Style/SoleNestedConditional:
671
674
  Enabled: true
675
+ AutoCorrect: true
672
676
  AllowModifier: true
673
677
 
674
678
  Style/UnpackFirst:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armitage-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1.1
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2020-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.1
19
+ version: 1.6.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.1
26
+ version: 1.6.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-performance
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.9.0
33
+ version: 1.9.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.9.0
40
+ version: 1.9.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.8.1
47
+ version: 2.9.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.8.1
54
+ version: 2.9.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0
61
+ version: 2.0.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0
68
+ version: 2.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -135,6 +135,7 @@ files:
135
135
  - ".yamllint"
136
136
  - CODE_OF_CONDUCT.md
137
137
  - Gemfile
138
+ - Gemfile.lock
138
139
  - LICENSE.txt
139
140
  - README.md
140
141
  - Rakefile
@@ -179,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
182
  requirements: []
182
- rubygems_version: 3.2.0.rc.1
183
+ rubygems_version: 3.2.0
183
184
  signing_key:
184
185
  specification_version: 4
185
186
  summary: A set of rubocop settings