rubocop-brands_insurance 1.3.0 → 1.4.0.pre.rc.2

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: 59e7d8b17ec7607fb042e15e3f7f15cd278db111e83733f3b4e7e8dc4e54a8b0
4
- data.tar.gz: 62956e6c421c04a5b8c9a7f26f0f3ae1fada39f17126e3bd4887caf5dc2f3e9d
3
+ metadata.gz: fb81a1bb8eee5ff7176afc7baff7a7a7bc1dd6d97229ecceb5893e34b9a53343
4
+ data.tar.gz: 37a5a91a8356363fe6ca22c3530e7f8752144ea392dff6ceefdf1459da84f110
5
5
  SHA512:
6
- metadata.gz: 364e1ad4efd1c169908bbe5655a6cfe1af3447c39a83b5798e98d6d494e763348c0d4a9ec8a03f0b221409de301e296e60392b8cf36cef31d668683d12023ac3
7
- data.tar.gz: 26f9c5441a5477d64ee774160c7467b6a46c1aa38a8c922d78c8102aad02ed88c8997e93069399b7b53f8cff9db5f26b6aa5ca48ecac90f479e71478b624dbb1
6
+ metadata.gz: 6f3bd57248613bf1e433cd09d5da07798d2a2099609d9ebe43af84b66e8c31561e60c5ce588d80c78e0b93fb21a99c1372fe5b510f0cddbf7fdf961c1dfaaeca
7
+ data.tar.gz: cbf22b6ecb8a5aa2f7125b1e9e547a7e5f51635d81a723fa457af3a8566d9873298b03a83bcd1ed56c80d801e60a0103fa8bb7c0a0101a7bb3c4251ba99feee8
data/README.adoc CHANGED
@@ -35,6 +35,7 @@ BrandsInsurance/Style/DisallowedMethods:
35
35
 
36
36
  == Departments
37
37
 
38
+ * xref:./docs/cops/layout/README.adoc[``Layout``]
38
39
  * xref:./docs/cops/style/README.adoc[``Style``]
39
40
 
40
41
  == Contributing
data/config/default.yml CHANGED
@@ -1,3 +1,10 @@
1
+ BrandsInsurance/Layout/MultilineArrayLineBreaks:
2
+ Description: 'Fork of base Layout/MultilineArrayLineBreaks rule'
3
+ Enabled: true
4
+ VersionAdded: '1.3.0'
5
+ AllowMultilineFinalElement: true
6
+ AllowPercentArray: true
7
+
1
8
  BrandsInsurance/Style/DisallowedMethods:
2
9
  Description: 'Disallows the usage of `#abort` and `#tap` methods'
3
10
  Enabled: true
@@ -0,0 +1,7 @@
1
+ = Layout
2
+
3
+ Layout cops check for stylistic whitespace in your code
4
+
5
+ == Cops
6
+
7
+ * xref:./multiline_array_line_breaks/README.adoc[``Layout/MultilineArrayLineBreaks``]
@@ -0,0 +1,44 @@
1
+ = ``Layout/MultilineArrayLineBreaks``
2
+
3
+ == Description
4
+
5
+ Extends the built-in link:https://docs.rubocop.org/rubocop/1.49/cops_layout.html#layoutmultilinearraylinebreaks[``Layout/MultilineArrayLineBreaks``]
6
+ and adds the ``AllowPercentArray`` option
7
+
8
+ == Examples
9
+
10
+ [source,ruby]
11
+ ----
12
+ # bad
13
+ %w[
14
+ 1
15
+ 2
16
+ 3
17
+ 4
18
+ ]
19
+
20
+ # good
21
+ %w[
22
+ 1 2
23
+ 3 4
24
+ ]
25
+ ----
26
+
27
+ == Configurable Attributes
28
+
29
+ |===
30
+ |Name |Default value |Configurable values
31
+
32
+ |AllowMultilineFinalElement
33
+ |false
34
+ |Boolean
35
+
36
+ |AllowPercentArray
37
+ |false
38
+ |Boolean
39
+
40
+ |===
41
+
42
+ == References
43
+
44
+ https://github.com/BrandsInsurance/expert-chainsaw/issues/1032
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module BrandsInsurance
5
- VERSION = '1.3.0'
5
+ VERSION = '1.4.0-rc.2'
6
6
  end
7
7
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module BrandsInsurance
6
+ module Layout
7
+ class MultilineArrayLineBreaks < RuboCop::Cop::Layout::MultilineArrayLineBreaks
8
+ # @see super
9
+ def on_array(node)
10
+ return if allowed_percent_array?(node)
11
+
12
+ super
13
+ end
14
+
15
+ private
16
+
17
+ # Check conig option
18
+ #
19
+ # @return [Boolean]
20
+ #
21
+ def allowed_percent_array?(node)
22
+ cop_config.fetch('AllowPercentArray', true) && node.percent_literal?
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'brands_insurance/style/disallowed_methods'
4
+ require_relative 'brands_insurance/layout/multiline_array_line_breaks'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-brands_insurance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -35,6 +35,8 @@ files:
35
35
  - LICENSE.txt
36
36
  - README.adoc
37
37
  - config/default.yml
38
+ - docs/cops/layout/README.adoc
39
+ - docs/cops/layout/multiline_array_line_breaks/README.adoc
38
40
  - docs/cops/style/README.adoc
39
41
  - docs/cops/style/disallowed_methods/README.adoc
40
42
  - lib/rubocop-brands_insurance.rb
@@ -44,6 +46,7 @@ files:
44
46
  - lib/rubocop/cop/brands_insurance/generator.rb
45
47
  - lib/rubocop/cop/brands_insurance/generator/cop_readme_injector.rb
46
48
  - lib/rubocop/cop/brands_insurance/generator/dept_readme_injector.rb
49
+ - lib/rubocop/cop/brands_insurance/layout/multiline_array_line_breaks.rb
47
50
  - lib/rubocop/cop/brands_insurance/style/disallowed_methods.rb
48
51
  - lib/rubocop/cop/brands_insurance_cops.rb
49
52
  homepage: https://github.com/BrandsInsurance/expert-chainsaw/
@@ -65,9 +68,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
68
  version: 3.0.1
66
69
  required_rubygems_version: !ruby/object:Gem::Requirement
67
70
  requirements:
68
- - - ">="
71
+ - - ">"
69
72
  - !ruby/object:Gem::Version
70
- version: '0'
73
+ version: 1.3.1
71
74
  requirements: []
72
75
  rubygems_version: 3.2.15
73
76
  signing_key: