rubocop-bridgetown 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -45
- data/README.md +28 -20
- data/lib/rubocop/cop/bridgetown/no_p_allowed.rb +1 -1
- data/lib/rubocop/cop/bridgetown/no_puts_allowed.rb +1 -1
- data/lib/rubocop-bridgetown.rb +3 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb6d3e6825f1929dbfed46f7be399fc2703f7fdeaa437650f86646c39bddbf7d
|
4
|
+
data.tar.gz: 18cc1d2c1f61d8e9ab22ffa73cffba0ba6662d2d6afcba4adaf06058971414b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bd13f4ea333ae0b881448aa38cbecff5bd28573f861dacb0b72d717e33b362dd81d9f47dbffaa86f5af33cbcc0b4bd07ac49e9b84aa1ed9ab81fc566a7a1c16
|
7
|
+
data.tar.gz: 25e09c13f71fd2bc278c56b1cec585fd9f209436b153060cc2a4e1c498a8467d7b244b81772977ff0dbc7e49b0018dfc1f143a88e251fffcbb4f7939d27844ae
|
data/.rubocop.yml
CHANGED
@@ -3,6 +3,8 @@ require:
|
|
3
3
|
|
4
4
|
AllCops:
|
5
5
|
TargetRubyVersion: 2.5
|
6
|
+
NewCops: enable
|
7
|
+
SuggestExtensions: false
|
6
8
|
Exclude:
|
7
9
|
- bin/**/*
|
8
10
|
- exe/**/*
|
@@ -12,35 +14,31 @@ AllCops:
|
|
12
14
|
- vendor/**/*
|
13
15
|
- tmp/**/*
|
14
16
|
|
15
|
-
Layout/
|
16
|
-
|
17
|
-
Layout/
|
17
|
+
Layout/EmptyComment:
|
18
|
+
Enabled: false
|
19
|
+
Layout/EndAlignment:
|
18
20
|
Severity: error
|
19
21
|
Layout/FirstArrayElementIndentation:
|
20
22
|
EnforcedStyle: consistent
|
21
23
|
Layout/FirstHashElementIndentation:
|
22
24
|
EnforcedStyle: consistent
|
25
|
+
Layout/HashAlignment:
|
26
|
+
EnforcedHashRocketStyle: table
|
27
|
+
Layout/IndentationWidth:
|
28
|
+
Severity: error
|
23
29
|
Layout/MultilineMethodCallIndentation:
|
24
30
|
EnforcedStyle: indented
|
25
31
|
Layout/MultilineOperationIndentation:
|
26
32
|
EnforcedStyle: indented
|
27
|
-
Layout/
|
28
|
-
|
29
|
-
|
30
|
-
Severity: error
|
31
|
-
Lint/RaiseException:
|
32
|
-
Enabled: true
|
33
|
-
Lint/StructNewOverride:
|
34
|
-
Enabled: true
|
33
|
+
Layout/LineLength:
|
34
|
+
Max: 100
|
35
|
+
Severity: warning
|
35
36
|
Lint/UnreachableCode:
|
36
37
|
Severity: error
|
37
38
|
Metrics/AbcSize:
|
38
39
|
Max: 24
|
39
40
|
Metrics/ClassLength:
|
40
41
|
Max: 240
|
41
|
-
Layout/LineLength:
|
42
|
-
Max: 100
|
43
|
-
Severity: warning
|
44
42
|
Metrics/MethodLength:
|
45
43
|
CountComments: false
|
46
44
|
Max: 20
|
@@ -67,42 +65,20 @@ Style/Documentation:
|
|
67
65
|
Enabled: false
|
68
66
|
Style/DoubleNegation:
|
69
67
|
Enabled: false
|
70
|
-
Style/
|
71
|
-
|
72
|
-
Style/
|
73
|
-
Enabled: true
|
74
|
-
Style/HashSyntax: # This now adheres to GitHub's newest Ruby style guide
|
75
|
-
EnforcedStyle: ruby19
|
76
|
-
SupportedStyles:
|
77
|
-
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
|
78
|
-
- ruby19
|
79
|
-
# checks for hash rocket syntax for all hashes
|
80
|
-
- hash_rockets
|
81
|
-
# forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
|
82
|
-
- no_mixed_keys
|
83
|
-
# enforces both ruby19 and no_mixed_keys styles
|
84
|
-
- ruby19_no_mixed_keys
|
85
|
-
# Force hashes that have a symbol value to use hash rockets
|
86
|
-
UseHashRocketsWithSymbolValues: false
|
87
|
-
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
88
|
-
PreferHashRocketsForNonAlnumEndingSymbols: false
|
89
|
-
Style/HashTransformKeys:
|
68
|
+
Style/Lambda:
|
69
|
+
EnforcedStyle: literal
|
70
|
+
Style/LambdaCall:
|
90
71
|
Enabled: false
|
91
|
-
Style/HashTransformValues:
|
92
|
-
Enabled: true
|
93
72
|
Style/ModuleFunction:
|
94
73
|
Enabled: false
|
74
|
+
Style/MultilineBlockChain:
|
75
|
+
Enabled: false
|
95
76
|
Style/MultilineTernaryOperator:
|
96
77
|
Severity: error
|
78
|
+
Style/ParallelAssignment:
|
79
|
+
Enabled: false
|
97
80
|
Style/PercentLiteralDelimiters:
|
98
|
-
|
99
|
-
"%q": "{}"
|
100
|
-
"%Q": "{}"
|
101
|
-
"%r": "!!"
|
102
|
-
"%s": "()"
|
103
|
-
"%w": "()"
|
104
|
-
"%W": "()"
|
105
|
-
"%x": "()"
|
81
|
+
Enabled: false
|
106
82
|
Style/RegexpLiteral:
|
107
83
|
EnforcedStyle: percent_r
|
108
84
|
Style/RescueModifier:
|
@@ -114,7 +90,7 @@ Style/StringLiterals:
|
|
114
90
|
Style/StringLiteralsInInterpolation:
|
115
91
|
EnforcedStyle: double_quotes
|
116
92
|
Style/SymbolArray:
|
117
|
-
|
93
|
+
Enabled: false
|
118
94
|
Style/TrailingCommaInArrayLiteral:
|
119
95
|
EnforcedStyleForMultiline: consistent_comma
|
120
96
|
Style/TrailingCommaInHashLiteral:
|
data/README.md
CHANGED
@@ -1,34 +1,27 @@
|
|
1
1
|
# RuboCop Bridgetown
|
2
2
|
|
3
|
-
A RuboCop extension to enforce common code style in Bridgetown
|
3
|
+
A RuboCop extension to enforce a common code style in the Bridgetown ecosystem and beyond.
|
4
4
|
|
5
5
|

|
6
|
-

|
7
7
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
Just
|
12
|
-
|
13
|
-
```
|
14
|
-
gem install rubocop-bridgetown
|
15
|
-
```
|
16
|
-
|
17
|
-
or if you prefer Bundler, add it to your `Gemfile` or `gemspec`
|
11
|
+
Just add the `rubocop-bridgetown` gem to your Gemfile.
|
18
12
|
|
19
13
|
```ruby
|
20
14
|
# Gemfile
|
21
15
|
|
22
|
-
gem "rubocop-bridgetown", "~> 0.
|
16
|
+
gem "rubocop-bridgetown", "~> 0.3"
|
23
17
|
```
|
24
18
|
```ruby
|
25
19
|
# <plugin>.gemspec
|
26
20
|
|
27
|
-
spec.add_development_dependency "rubocop-bridgetown", "~> 0.
|
21
|
+
spec.add_development_dependency "rubocop-bridgetown", "~> 0.3"
|
28
22
|
```
|
29
23
|
and run `bundle install`
|
30
24
|
|
31
|
-
|
32
25
|
## Usage
|
33
26
|
|
34
27
|
You need to tell RuboCop to load the extension and *inherit* the custom RuboCop configuration advocated by
|
@@ -44,17 +37,32 @@ inherit_gem:
|
|
44
37
|
|
45
38
|
Running `bundle exec rubocop` will now automatically load the `rubocop-bridgetown` cops together with the standard cops.
|
46
39
|
|
40
|
+
You can also add a `rubocop` task to your `Rakefile`.
|
47
41
|
|
48
|
-
|
42
|
+
```ruby
|
43
|
+
# Rakefile
|
49
44
|
|
50
|
-
|
45
|
+
require "rubocop/rake_task"
|
51
46
|
|
47
|
+
RuboCop::RakeTask.new
|
48
|
+
```
|
49
|
+
|
50
|
+
## Exclude Folders List
|
52
51
|
|
53
|
-
|
52
|
+
Currently it seems Rubocop doesn't inherit the `Excludes` folder list from the gem configuration, so you may want to add it manually to your `.rubocop.yml` file:
|
54
53
|
|
55
|
-
|
54
|
+
```yaml
|
55
|
+
AllCops:
|
56
|
+
Exclude:
|
57
|
+
- bin/**/*
|
58
|
+
- exe/**/*
|
59
|
+
- benchmark/**/*
|
60
|
+
- node_modules/**/*
|
61
|
+
- script/**/*
|
62
|
+
- vendor/**/*
|
63
|
+
- tmp/**/*
|
64
|
+
```
|
56
65
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
4. A new minor release is subsequently cut and shipped.
|
66
|
+
## Customization
|
67
|
+
|
68
|
+
You can override any settings inherited from the extension by subsequently redefining the concerned parameters.
|
data/lib/rubocop-bridgetown.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-bridgetown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.22'
|
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:
|
26
|
+
version: '1.22'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-performance
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.11'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.11'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|