gitlab-styles 5.3.0 → 5.4.0

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: 53b2719f9b6600bdfd8b362ad363f86f35dbae708f8ebd41f1ef2e2429d4c4f0
4
- data.tar.gz: f480238835c2218118ea34ac3ebf2869e2386e500304530fd08a112701175845
3
+ metadata.gz: b2ceb4c3c99df5b88255a7b7bcd4cbfaa5e029f81cc73f09b937cb15b7e53ffd
4
+ data.tar.gz: e4e5a5425299c7cb3d8e40f79fb4f817444aec62c378d8c8b547a309e3fe7211
5
5
  SHA512:
6
- metadata.gz: f5d87f035504e911546c7aaaaad23bac44035f65848d0a3c74cf284bdddd4e8f460c6da7e4766ee9465f75051d38d5e1d3c4b674bc910ce320204e356a9f3622
7
- data.tar.gz: b97be714bb886604639de5d788284b0c8af1b081ce279c8a5fdf6dafff9b2aeee83060576f0ce0322bb49168ccdc58a4abafd0de13442425d705523d9d6a6a5d
6
+ metadata.gz: 1626e2623b8e2d5bb2eeff292a4746a8352f302a53277b9118bd20494f6489501f7f19c0442510435ca55ac92cdf61536dfe5bb5c3ad09a9f3eea1b769636780
7
+ data.tar.gz: b64077d9097e0d3adb6365fe41662b6e5264921ebfa5ed493b7dec7c8eaa8dbc4ae63c286b51f34b55811664a8a8e3fa9da5aa0098840f5dfddac54c9af419b4
@@ -3,3 +3,8 @@ inherit_from:
3
3
 
4
4
  require:
5
5
  - rubocop/cop/internal_affairs
6
+
7
+ InternalAffairs/DeprecateCopHelper:
8
+ Enabled: true
9
+ Include:
10
+ - spec/**/*.rb
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module Styles
5
+ module Rubocop
6
+ module Cop
7
+ module InternalAffairs
8
+ # Cop that denies the use of CopHelper.
9
+ class DeprecateCopHelper < RuboCop::Cop::Cop
10
+ MSG = 'Do not use `CopHelper` or methods from it, use improved patterns described in https://github.com/rubocop-hq/rubocop/issues/8003'
11
+
12
+ def_node_matcher :cop_helper, <<~PATTERN
13
+ (send nil? ${:include :extend :prepend}
14
+ (const _ {:CopHelper}))
15
+ PATTERN
16
+
17
+ def_node_search :cop_helper_method, <<~PATTERN
18
+ (send nil? {:inspect_source :inspect_source_file :parse_source :autocorrect_source_file :autocorrect_source :_investigate} ...)
19
+ PATTERN
20
+
21
+ def_node_search :cop_helper_method_on_instance, <<~PATTERN
22
+ (send (send nil? _) {:messages :highlights :offenses} ...)
23
+ PATTERN
24
+
25
+ def on_send(node)
26
+ cop_helper(node) do
27
+ add_offense(node)
28
+ end
29
+
30
+ cop_helper_method(node) do
31
+ add_offense(node)
32
+ end
33
+
34
+ cop_helper_method_on_instance(node) do
35
+ add_offense(node)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Styles
5
- VERSION = '5.3.0'
5
+ VERSION = '5.4.0'
6
6
  end
7
7
  end
@@ -20,3 +20,6 @@ inherit_from:
20
20
  - rubocop-rspec.yml
21
21
  - rubocop-security.yml
22
22
  - rubocop-style.yml
23
+
24
+ InternalAffairs/DeprecateCopHelper:
25
+ Enabled: false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-styles
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-11 00:00:00.000000000 Z
11
+ date: 2021-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -153,6 +153,7 @@ files:
153
153
  - lib/gitlab/styles/rubocop/cop/custom_error_class.rb
154
154
  - lib/gitlab/styles/rubocop/cop/gem_fetcher.rb
155
155
  - lib/gitlab/styles/rubocop/cop/in_batches.rb
156
+ - lib/gitlab/styles/rubocop/cop/internal_affairs/deprecate_cop_helper.rb
156
157
  - lib/gitlab/styles/rubocop/cop/line_break_after_guard_clauses.rb
157
158
  - lib/gitlab/styles/rubocop/cop/line_break_around_conditional_block.rb
158
159
  - lib/gitlab/styles/rubocop/cop/migration/update_large_table.rb