armitage-rubocop 0.72.0 → 0.73.0.117

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: 057ca83ae6e4b2e7c20139d602a0ff431b9f37c98af7f0b551002bcc48ae0a97
4
- data.tar.gz: f45fda7d7ff502bc5a56b027d0a4cca88f95c0d71457c78709ef8d0c90f6d760
3
+ metadata.gz: 83d1c608fb4c6aab4f54f7dfce2a9cc6a945e3a48f3b1ad1e36ec796ca18a43b
4
+ data.tar.gz: f92f270fdb073e2b3992935b0c54470181f6f78dcfbd0d04b68bca8ab9b88da6
5
5
  SHA512:
6
- metadata.gz: 23fed537ab129efd2aa9ceb1672466011ab37d01ffd869340c7aa2ca87f9a8246ec1ee943a612bbdd778045a6c86707d15b12e08c630457ba1d00c5d0eee05e8
7
- data.tar.gz: c708cbeee868a592e974b05a810921232c52ca0deaceefe6f2b17383d4e26f435d3156ba0b3f9e6498496de28bbbf0b8d26cdbf55bd0524c3de91545ce2af1d1
6
+ metadata.gz: 3bf7c0369bb088a458ca506cbceeff1033708a6240b344604d53f5cfb0df13be32c971b8decea1475dad901c0355e3e1abc9b050fe81805c2cc57affdfeb5642
7
+ data.tar.gz: b004650ed1011264431d6db9c11931d1287cedeb2d93f1f2a588ea8e81fc04568343ae14e1a4de3a0682cfeb20918786839edcaabb89be566107121202c372e0
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: ./lib/rubocop.general.yml
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 Rustam Ibragimov
3
+ Copyright (c) 2018-2019 Rustam Ibragimov
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ require 'rubocop/rake_task'
5
5
  require 'open3'
6
6
  require 'yaml'
7
7
  require 'rubocop'
8
+ require 'rubocop-rails'
8
9
  require 'rubocop-performance'
9
10
  require 'rubocop-rspec'
10
11
 
@@ -15,6 +16,8 @@ RuboCop::RakeTask.new(:rubocop) do |t|
15
16
  t.requires << 'rubocop-rails'
16
17
  end
17
18
 
19
+ NON_CHECKABLE_COPS = %w[Rails].freeze # NOTE: Global Rails cop has only `Enabled` option
20
+
18
21
  namespace :armitage_rubocop do
19
22
  task :build do
20
23
  build_processes = {
@@ -56,7 +59,11 @@ namespace :armitage_rubocop do
56
59
 
57
60
  # NOTE: try to load without Psych exceptions
58
61
  invalid_yamls = yamls.each_with_object([]) do |file_name, invalid_files|
59
- YAML.load(File.read(file_name)) rescue (invalid_files << "- \e[33m#{file_name}\e[0m")
62
+ begin
63
+ YAML.safe_load(File.read(file_name))
64
+ rescue StandardError
65
+ (invalid_files << "- \e[33m#{file_name}\e[0m")
66
+ end
60
67
  end
61
68
 
62
69
  if invalid_yamls.empty?
@@ -88,21 +95,26 @@ namespace :armitage_rubocop do
88
95
  next if RuboCop::ConfigLoader.default_configuration.key?(cop)
89
96
  next if RuboCop::Cop::Cop.registry.contains_cop_matching?([cop])
90
97
  next if cop == 'inherit_mode'
98
+
91
99
  invalid_cops[cop] = "\e[31mBAD COP\e[0m"
92
100
  end
93
101
 
94
102
  # NOTE: validate cop params
95
103
  rubocop_config.keys.each do |cop|
96
104
  next if invalid_cops.key?(cop)
105
+
97
106
  invalid_params = Set.new
98
107
 
99
108
  rubocop_config[cop].each_key do |cop_param|
100
109
  next if RuboCop::Config::COMMON_PARAMS.include?(cop_param)
110
+ next if NON_CHECKABLE_COPS.include?(cop)
101
111
  next if RuboCop::ConfigLoader.default_configuration[cop].key?(cop_param)
112
+
102
113
  invalid_params << "\e[35m#{cop_param}\e[0m"
103
114
  end
104
115
 
105
116
  next if invalid_params.empty?
117
+
106
118
  invalid_cops[cop] = "\e[31mBAD PARAMS\e[0m: #{invalid_params.to_a.join(', ')}"
107
119
  end
108
120
  end
@@ -1,11 +1,10 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  lib = File.expand_path('lib', __dir__)
5
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
5
 
7
6
  Gem::Specification.new do |spec|
8
- gem_version = '0.72.0'
7
+ gem_version = '0.73.0'
9
8
  release_version = ENV['TRAVIS'] ? "#{gem_version}.#{ENV['TRAVIS_BUILD_NUMBER']}" : gem_version
10
9
 
11
10
  spec.name = 'armitage-rubocop'
@@ -24,10 +23,10 @@ Gem::Specification.new do |spec|
24
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
24
  end
26
25
 
27
- spec.add_dependency 'rubocop', '= 0.72.0'
26
+ spec.add_dependency 'rubocop', '= 0.73.0'
28
27
  spec.add_dependency 'rubocop-performance', '= 1.4.0'
28
+ spec.add_dependency 'rubocop-rails', '= 2.2.1'
29
29
  spec.add_dependency 'rubocop-rspec', '= 1.33.0'
30
- spec.add_dependency 'rubocop-rails', '= 2.1.0'
31
30
 
32
31
  spec.add_development_dependency 'bundler'
33
32
  spec.add_development_dependency 'rake'
@@ -199,6 +199,7 @@ Layout/LeadingBlankLines:
199
199
 
200
200
  Layout/LeadingCommentSpace:
201
201
  Enabled: true
202
+ AllowDoxygenCommentStyle: false
202
203
 
203
204
  Layout/MultilineArrayBraceLayout:
204
205
  Enabled: true
data/lib/common/style.yml CHANGED
@@ -277,6 +277,9 @@ Style/MultilineMethodSignature:
277
277
  Style/MultilineTernaryOperator:
278
278
  Enabled: false
279
279
 
280
+ Style/MultilineWhenThen:
281
+ Enabled: true
282
+
280
283
  Style/MultipleComparison:
281
284
  Enabled: true
282
285
 
@@ -410,6 +413,7 @@ Style/ReturnNil:
410
413
 
411
414
  Style/SafeNavigation:
412
415
  Enabled: true
416
+ ConvertCodeThatCanStartToReturnNil: false
413
417
 
414
418
  Style/Sample:
415
419
  Enabled: true
data/lib/rspec/rspec.yml CHANGED
@@ -22,10 +22,6 @@ RSpec/BeforeAfterAll:
22
22
  RSpec/ContextWording:
23
23
  Enabled: false
24
24
 
25
- RSpec/Dialect:
26
- Enabled: true
27
- PreferredMethods: {}
28
-
29
25
  RSpec/DescribeClass:
30
26
  Enabled: false
31
27
 
@@ -40,6 +36,10 @@ RSpec/DescribedClass:
40
36
  SkipBlocks: false
41
37
  EnforcedStyle: described_class
42
38
 
39
+ RSpec/Dialect:
40
+ Enabled: true
41
+ PreferredMethods: {}
42
+
43
43
  RSpec/EmptyExampleGroup:
44
44
  Enabled: true
45
45
 
@@ -118,6 +118,10 @@ RSpec/IteratedExpectation:
118
118
  RSpec/LeadingSubject:
119
119
  Enabled: true
120
120
 
121
+ # NOTE: will be introduced in next release
122
+ # RSpec/LeakyConstantDeclaration:
123
+ # Enabled: true
124
+
121
125
  RSpec/LetBeforeExamples:
122
126
  Enabled: true
123
127
 
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: 0.72.0
4
+ version: 0.73.0.117
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-28 00:00:00.000000000 Z
11
+ date: 2019-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.72.0
19
+ version: 0.73.0
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: 0.72.0
26
+ version: 0.73.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-performance
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.4.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rubocop-rspec
42
+ name: rubocop-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.33.0
47
+ version: 2.2.1
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: 1.33.0
54
+ version: 2.2.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop-rails
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.1.0
61
+ version: 1.33.0
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.1.0
68
+ version: 1.33.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +103,7 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - ".gitignore"
106
+ - ".rubocop.yml"
106
107
  - CODE_OF_CONDUCT.md
107
108
  - Gemfile
108
109
  - LICENSE.txt
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  - !ruby/object:Gem::Version
147
148
  version: '0'
148
149
  requirements: []
149
- rubygems_version: 3.0.3
150
+ rubygems_version: 3.0.4
150
151
  signing_key:
151
152
  specification_version: 4
152
153
  summary: A set of rubocop settings