rubocop-brands_insurance 1.4.0.pre.rc.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +5 -0
- data/README.adoc +1 -0
- data/config/default.yml +7 -0
- data/docs/cops/layout/README.adoc +7 -0
- data/docs/cops/layout/multiline_array_line_breaks/README.adoc +44 -0
- data/docs/cops/style/disallowed_methods/README.adoc +1 -1
- data/lib/rubocop/brands_insurance/version.rb +1 -1
- data/lib/rubocop/cop/brands_insurance/layout/multiline_array_line_breaks.rb +28 -0
- data/lib/rubocop/cop/brands_insurance_cops.rb +1 -0
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dc021723b9b62a27f1c2cf2e184fe9554361ba2adf6d242d46564bffb037bc9
|
4
|
+
data.tar.gz: ccad1ac23800990dc0bcfaa69d8b758a444860363d8ee20e3f64396ef4ca2118
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1866b79026d4d034f57bf6c6a0c90c3c3e4aac9d2a1860461f7e54c29837cb7d794003ebdeec11b26c6a33b8a04057d56265e50828b2a41ad41b0e51ac303fdb
|
7
|
+
data.tar.gz: 710c972af380d96c4803ca482ad4d55906a1d420a269b2a6ed2a0de4b46aeb88487b851930403c8b7b5fcb39fa8774f61b4cd847bb093ce45666f0d69b9ea605
|
data/CHANGELOG.adoc
CHANGED
data/README.adoc
CHANGED
data/config/default.yml
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
BrandsInsurance/Layout/MultilineArrayLineBreaks:
|
2
|
+
Description: 'Extends base Layout/MultilineArrayLineBreaks cop'
|
3
|
+
Enabled: true
|
4
|
+
VersionAdded: '1.4.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,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
|
@@ -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
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-brands_insurance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brands Insurance
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.49.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubomatic
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.2.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.2.0
|
27
41
|
description:
|
28
42
|
email:
|
29
43
|
- documents@brandsinsurance.com
|
@@ -35,6 +49,8 @@ files:
|
|
35
49
|
- LICENSE.txt
|
36
50
|
- README.adoc
|
37
51
|
- config/default.yml
|
52
|
+
- docs/cops/layout/README.adoc
|
53
|
+
- docs/cops/layout/multiline_array_line_breaks/README.adoc
|
38
54
|
- docs/cops/style/README.adoc
|
39
55
|
- docs/cops/style/disallowed_methods/README.adoc
|
40
56
|
- lib/rubocop-brands_insurance.rb
|
@@ -44,6 +60,7 @@ files:
|
|
44
60
|
- lib/rubocop/cop/brands_insurance/generator.rb
|
45
61
|
- lib/rubocop/cop/brands_insurance/generator/cop_readme_injector.rb
|
46
62
|
- lib/rubocop/cop/brands_insurance/generator/dept_readme_injector.rb
|
63
|
+
- lib/rubocop/cop/brands_insurance/layout/multiline_array_line_breaks.rb
|
47
64
|
- lib/rubocop/cop/brands_insurance/style/disallowed_methods.rb
|
48
65
|
- lib/rubocop/cop/brands_insurance_cops.rb
|
49
66
|
homepage: https://github.com/BrandsInsurance/expert-chainsaw/
|
@@ -65,9 +82,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
82
|
version: 3.0.1
|
66
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
84
|
requirements:
|
68
|
-
- - "
|
85
|
+
- - ">="
|
69
86
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
87
|
+
version: '0'
|
71
88
|
requirements: []
|
72
89
|
rubygems_version: 3.2.15
|
73
90
|
signing_key:
|