gitlab-styles 4.2.0 → 4.3.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: 86448d470052f87f4e8cac92516a549a08101b13ce226f9f409bbab6577eae8d
4
- data.tar.gz: 4b4e3ad68914fcdd80e5a9d208076b697237bab2d2f469b417f985eb358f380a
3
+ metadata.gz: 00dda1d4ea5cfd931d74ccf3def7dd6ed3552359c2519e7b6a73464cb3612b92
4
+ data.tar.gz: 8fd90715af2921b22e53d241f12e4a546f8d53923a688028132af3e5e28f0349
5
5
  SHA512:
6
- metadata.gz: 5be83ec65d0f6f4f019a2357d730d1c28071c40e20f230e28fcb4caa044c16c18cc0a43f6b1dd2d9bbd6e7abfe70f42dd7b5a2b25230c1ae3bfadb932169050d
7
- data.tar.gz: a7b2d85615687f1e8bcf85b6a89da0c1e1f93e27ea4c9bca938dbc51cb37d4287f4b0a52792232650050db25a7d7dff7e11f6fa8a7f5ad0c763f82800aab660f
6
+ metadata.gz: 58e29fee8c087356c272e72e9d3a8b719581e5f185ceed85d554a9ccb664654288373b2a6d1e4c1ba9587bfce4c2225960797e4c89e321688da8fa52d4a12b81
7
+ data.tar.gz: a2c2f9843238a87f1af60f28beac5ec8c1ae5f1d236ab1554e88d07f95824e6474dda3b96ff5ec26a3219015c5415ea21824d41cc98d3cd06990b5ff55104097
@@ -32,4 +32,4 @@ with the latest commit from https://gitlab.com/gitlab-org/gitlab-styles/commits/
32
32
  - Checklist after merging:
33
33
  - [ ] [Create a tag for the new release version](docs/release_process.md#how-to).
34
34
 
35
- /label ~"Engineering Productivity" ~backstage
35
+ /label ~"Engineering Productivity" ~"tooling::workflow"
@@ -14,6 +14,7 @@ require 'gitlab/styles/rubocop/cop/rspec/single_line_hook'
14
14
  require 'gitlab/styles/rubocop/cop/rspec/have_link_parameters'
15
15
  require 'gitlab/styles/rubocop/cop/rspec/verbose_include_metadata'
16
16
  require 'gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example'
17
+ require 'gitlab/styles/rubocop/cop/rspec/empty_line_after_let_block'
17
18
 
18
19
  module Gitlab
19
20
  module Styles
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubocop-rspec'
4
+
5
+ module Gitlab
6
+ module Styles
7
+ module Rubocop
8
+ module Cop
9
+ module RSpec
10
+ # Checks if there is an empty line after let blocks.
11
+ #
12
+ # @example
13
+ # # bad
14
+ # RSpec.describe Foo do
15
+ # let(:something) { 'something' }
16
+ # let(:another_thing) do
17
+ # end
18
+ # let(:something_else) do
19
+ # end
20
+ # let(:last_thing) { 'last thing' }
21
+ # end
22
+ #
23
+ # # good
24
+ # RSpec.describe Foo do
25
+ # let(:something) { 'something' }
26
+ # let(:another_thing) do
27
+ # end
28
+ #
29
+ # let(:something_else) do
30
+ # end
31
+ #
32
+ # let(:last_thing) { 'last thing' }
33
+ # end
34
+ #
35
+ # # good - it's ok to have non-separated without do/end blocks
36
+ # RSpec.describe Foo do
37
+ # let(:something) { 'something' }
38
+ # let(:last_thing) { 'last thing' }
39
+ # end
40
+ #
41
+ class EmptyLineAfterLetBlock < RuboCop::Cop::RSpec::Cop
42
+ include RuboCop::RSpec::BlankLineSeparation
43
+
44
+ MSG = 'Add an empty line after `%<let>s` block.'
45
+
46
+ def_node_matcher :lets, Helpers::ALL.block_pattern
47
+
48
+ def on_block(node)
49
+ lets(node) do
50
+ break if last_child?(node)
51
+ next if node.single_line?
52
+
53
+ missing_separating_line(node) do |location|
54
+ add_offense(node,
55
+ location: location,
56
+ message: format(MSG, let: node.method_name))
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Styles
5
- VERSION = '4.2.0'
5
+ VERSION = '4.3.0'
6
6
  end
7
7
  end
@@ -36,6 +36,10 @@ RSpec/EmptyExampleGroup:
36
36
  - it_should_email!
37
37
  - it_should_not_email!
38
38
 
39
+ # Checks if there is an empty line after let blocks.
40
+ RSpec/EmptyLineAfterLetBlock:
41
+ Enabled: true
42
+
39
43
  # Checks if there is an empty line after shared example blocks.
40
44
  RSpec/EmptyLineAfterSharedExample:
41
45
  Enabled: true
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: 4.2.0
4
+ version: 4.3.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-05-19 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -155,6 +155,7 @@ files:
155
155
  - lib/gitlab/styles/rubocop/cop/migration/update_large_table.rb
156
156
  - lib/gitlab/styles/rubocop/cop/polymorphic_associations.rb
157
157
  - lib/gitlab/styles/rubocop/cop/redirect_with_status.rb
158
+ - lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_let_block.rb
158
159
  - lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example.rb
159
160
  - lib/gitlab/styles/rubocop/cop/rspec/have_link_parameters.rb
160
161
  - lib/gitlab/styles/rubocop/cop/rspec/single_line_hook.rb
@@ -196,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
197
  - !ruby/object:Gem::Version
197
198
  version: '0'
198
199
  requirements: []
199
- rubygems_version: 3.1.3
200
+ rubygems_version: 3.1.4
200
201
  signing_key:
201
202
  specification_version: 4
202
203
  summary: GitLab style guides and shared style configs.