rubocop-dbl 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -66
- data/config/cops/layout.yml +0 -3
- data/config/cops/lint.yml +0 -9
- data/config/cops/metrics.yml +8 -3
- data/config/cops/naming.yml +1 -2
- data/config/cops/performance.yml +0 -1
- data/config/cops/rails.yml +0 -20
- data/config/cops/rspec.yml +0 -5
- data/config/cops/style.yml +0 -18
- data/config/cops/types.yml +0 -1
- data/lib/generators/rubocop_dbl/install_generator.rb +1 -0
- data/lib/rubocop_dbl/version.rb +1 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5856effa41bb2d7e4dde8aefb6f9944b84801e9683a8fd8383e446ae293a5a
|
4
|
+
data.tar.gz: cf576d04a8975fb239afcaf06d63a9138de9bf32916acb8bb9eb32be7d704e49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ae420c179b0be16109a50b0b45b5ea7c9561c10e5a7e3650628cc815613a65410329f621e47f57f94cb5dc8dd0cd03d3390a8a5ab97bd9a7ac40918f2afc73
|
7
|
+
data.tar.gz: 44d1c398449529e67d03c0fe1c9752a58207e84e91de19e8b5f561eb65d1da8876584a7551e2278aae8136a8d591c8810ae119f72c48469d685da5c1c4fdf16b
|
data/README.md
CHANGED
@@ -6,41 +6,25 @@ RuboCop configuration for our Ruby on Rails projects.
|
|
6
6
|
|
7
7
|
[Official RoR RuboCop Configuration](https://github.com/rails/rails/blob/master/.rubocop.yml).
|
8
8
|
|
9
|
-
Releases are published to [
|
10
|
-
|
9
|
+
Releases are published to [RubyGems](https://rubygems.org/gems/rubocop-dbl).
|
11
10
|
|
12
11
|
## Installation
|
13
12
|
|
14
|
-
Install from command line:
|
15
|
-
|
16
|
-
```shell
|
17
|
-
gem install rubocop-dbl --version "0.2.0" --source "https://rubygems.pkg.github.com/dbl-works"
|
18
|
-
```
|
19
|
-
|
20
|
-
install via Gemfile:
|
21
|
-
|
22
|
-
DO NOT DO THIS:
|
23
13
|
```ruby
|
24
14
|
group :development, :test do
|
25
|
-
gem
|
15
|
+
gem 'rubocop-dbl'
|
26
16
|
end
|
27
17
|
```
|
28
18
|
|
29
|
-
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
# Gemfile
|
33
|
-
group :development, :test do
|
34
|
-
gem 'rubocop-dbl', git: 'git@github.com:dbl-works/rubocop-dbl', branch: :main
|
35
|
-
end
|
36
|
-
```
|
37
|
-
WHY: we cannot install a public (!!) package from GitHub packages without a PAT (personal access token), see this [thread](https://github.community/t/download-from-github-package-registry-without-authentication/14407).
|
38
|
-
E.g. CircleCI does not allow reading a ENV var within the ci.yml, hence it is impossible to configure bundle to have auth for GitHub packages (this might work using GitHub actions).
|
19
|
+
## Setup
|
39
20
|
|
21
|
+
run
|
40
22
|
|
41
|
-
|
23
|
+
```shell
|
24
|
+
rails generate rubocop_dbl:install
|
25
|
+
```
|
42
26
|
|
43
|
-
|
27
|
+
or manually Aad this line to your application's `.rubocop.yml`:
|
44
28
|
|
45
29
|
```yml
|
46
30
|
inherit_gem:
|
@@ -48,28 +32,16 @@ inherit_gem:
|
|
48
32
|
- config/dbl.yml
|
49
33
|
```
|
50
34
|
|
51
|
-
Or just run:
|
52
|
-
|
53
|
-
```shell
|
54
|
-
rails generate rubocop_dbl:install
|
55
|
-
```
|
56
|
-
|
57
|
-
|
58
|
-
|
59
35
|
## Configuration
|
60
36
|
|
61
|
-
|
62
37
|
### TargetRubyVersion
|
63
38
|
|
64
39
|
We only support the latest 2 versions of ruby, which is currently >= 2.7.
|
65
40
|
We only support the latest 2 versions of rails, which is currently >= 6.0.
|
66
41
|
See [test.yml](.github/workflows/test.yml) for details.
|
67
42
|
|
68
|
-
|
69
43
|
If you'd like to change `TargetRubyVersion`, see [Customization](#customization).
|
70
44
|
|
71
|
-
|
72
|
-
|
73
45
|
## Customization
|
74
46
|
|
75
47
|
If you'd like to customize the rubocop setting on your project, you can override it.
|
@@ -88,42 +60,16 @@ AllCops:
|
|
88
60
|
```
|
89
61
|
|
90
62
|
## Build & install gem locally
|
91
|
-
```shell
|
92
|
-
gem build rubocop-dbl.gemspec
|
93
|
-
gem install rubocop-dbl-0.1.0.gem
|
94
|
-
irb
|
95
|
-
```
|
96
|
-
|
97
|
-
## Publish as package on GitHub packages
|
98
|
-
* create a valid PAT (personal access token) for your GitHub user with full access to packages (read & write) and private repos (read), read the [docs](https://docs.github.com/en/free-pro-team@latest/packages/guides/configuring-rubygems-for-use-with-github-packages) for more details
|
99
|
-
* add following information to `~/.gemrc`:
|
100
|
-
|
101
|
-
```
|
102
|
-
---
|
103
|
-
:github: YOUR_PAT
|
104
|
-
:backtrace: false
|
105
|
-
:bulk_threshold: 1000
|
106
|
-
:sources:
|
107
|
-
- https://rubygems.org/
|
108
|
-
- https://rubygems.pkg.github.com
|
109
|
-
:update_sources: true
|
110
|
-
:verbose: true
|
111
|
-
:concurrent_downloads: 8
|
112
|
-
gem: "--document=yri"
|
113
|
-
|
114
|
-
```
|
115
|
-
|
116
|
-
* build the latest version of the gem locally with
|
117
63
|
|
118
64
|
```shell
|
119
65
|
gem build rubocop-dbl.gemspec
|
66
|
+
gem install rubocop-dbl-0.1.0.gem
|
120
67
|
```
|
121
|
-
take note of the most current version of the gem, which will be printed to console.
|
122
68
|
|
123
|
-
|
69
|
+
## Publish on RubyGems
|
124
70
|
|
125
71
|
```shell
|
126
|
-
|
72
|
+
bin/release
|
127
73
|
```
|
128
74
|
|
129
|
-
|
75
|
+
will guide you through the process.
|
data/config/cops/layout.yml
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Layout/EndAlignment:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/35'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
@@ -15,14 +14,12 @@
|
|
15
14
|
# assignments, where it should be aligned with the LHS.
|
16
15
|
# @NOTE: changed EnforcedStyleAlignWith from "keyword" to "variable"
|
17
16
|
Layout/EndAlignment:
|
18
|
-
Reference: 'we have no reference for this change'
|
19
17
|
Enabled: true
|
20
18
|
EnforcedStyleAlignWith: variable
|
21
19
|
AutoCorrect: true
|
22
20
|
|
23
21
|
# @NOTE: changed EnforcedStyle from "with_first_parameter" to "with_fixed_indentation"
|
24
22
|
Layout/ParameterAlignment:
|
25
|
-
Reference: 'we have no reference for this change'
|
26
23
|
EnforcedStyle: with_fixed_indentation
|
27
24
|
SupportedStyles:
|
28
25
|
- with_first_parameter
|
data/config/cops/lint.yml
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Lint/AmbiguousOperator:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/36'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
@@ -15,33 +14,25 @@
|
|
15
14
|
# @NOTE: the following cops are on "pending" by default
|
16
15
|
#
|
17
16
|
Lint/DuplicateBranch:
|
18
|
-
Reference: 'we have no reference for this change'
|
19
17
|
Enabled: true
|
20
18
|
|
21
19
|
Lint/DuplicateRegexpCharacterClassElement:
|
22
|
-
Reference: 'we have no reference for this change'
|
23
20
|
Enabled: true
|
24
21
|
|
25
22
|
Lint/EmptyBlock:
|
26
|
-
Reference: 'we have no reference for this change'
|
27
23
|
Enabled: true
|
28
24
|
|
29
25
|
Lint/EmptyClass:
|
30
|
-
Reference: 'we have no reference for this change'
|
31
26
|
Enabled: true
|
32
27
|
|
33
28
|
Lint/NoReturnInBeginEndBlocks:
|
34
|
-
Reference: 'we have no reference for this change'
|
35
29
|
Enabled: true
|
36
30
|
|
37
31
|
Lint/ToEnumArguments:
|
38
|
-
Reference: 'we have no reference for this change'
|
39
32
|
Enabled: true
|
40
33
|
|
41
34
|
Lint/UnexpectedBlockArity:
|
42
|
-
Reference: 'we have no reference for this change'
|
43
35
|
Enabled: true
|
44
36
|
|
45
37
|
Lint/UnmodifiedReduceAccumulator:
|
46
|
-
Reference: 'we have no reference for this change'
|
47
38
|
Enabled: true
|
data/config/cops/metrics.yml
CHANGED
@@ -7,15 +7,20 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Metrics/BlockLength:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/37'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
14
13
|
# @NOTE: IgnoredMethods by default only contains "refine"
|
15
14
|
Metrics/BlockLength:
|
16
|
-
|
17
|
-
IgnoredMethods:
|
15
|
+
Exclude:
|
18
16
|
- describe
|
19
17
|
- context
|
20
18
|
- feature
|
21
19
|
- scenario
|
20
|
+
|
21
|
+
Metrics/MethodLength:
|
22
|
+
Max: 30
|
23
|
+
CountAsOne:
|
24
|
+
- array
|
25
|
+
- heredoc
|
26
|
+
- method_call
|
data/config/cops/naming.yml
CHANGED
@@ -7,11 +7,10 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Naming/VariableNumber:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/38'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
14
13
|
# @NOTE: changed EnforcedStyle from "normalcase" to "snake_case"
|
14
|
+
# https://github.com/dbl-works/rubocop-dbl/pull/26
|
15
15
|
Naming/VariableNumber:
|
16
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/26'
|
17
16
|
EnforcedStyle: snake_case
|
data/config/cops/performance.yml
CHANGED
data/config/cops/rails.yml
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Rails/ActionFilter:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/33'
|
11
10
|
# Enabled: false
|
12
11
|
#
|
13
12
|
|
@@ -21,12 +20,10 @@ Rails/UnknownEnv:
|
|
21
20
|
|
22
21
|
# @NOTE: disabled
|
23
22
|
Rails/HttpStatus:
|
24
|
-
Reference: 'We have no reference for this change'
|
25
23
|
Enabled: false
|
26
24
|
|
27
25
|
# @NOTE: disabled
|
28
26
|
Rails/ApplicationController:
|
29
|
-
Reference: 'We have no reference for this change'
|
30
27
|
Enabled: false
|
31
28
|
|
32
29
|
|
@@ -34,70 +31,53 @@ Rails/ApplicationController:
|
|
34
31
|
# @NOTE: all the cops ahead are "pending" in the current default config
|
35
32
|
#
|
36
33
|
Rails/ActiveRecordCallbacksOrder:
|
37
|
-
Reference: 'We have no reference for this change'
|
38
34
|
Enabled: true
|
39
35
|
|
40
36
|
Rails/AfterCommitOverride:
|
41
|
-
Reference: 'We have no reference for this change'
|
42
37
|
Enabled: true
|
43
38
|
|
44
39
|
Rails/AttributeDefaultBlockValue:
|
45
|
-
Reference: 'We have no reference for this change'
|
46
40
|
Enabled: true
|
47
41
|
|
48
42
|
Rails/FindById:
|
49
|
-
Reference: 'We have no reference for this change'
|
50
43
|
Enabled: true
|
51
44
|
|
52
45
|
Rails/Inquiry:
|
53
|
-
Reference: 'We have no reference for this change'
|
54
46
|
Enabled: true
|
55
47
|
|
56
48
|
Rails/MailerName:
|
57
|
-
Reference: 'We have no reference for this change'
|
58
49
|
Enabled: true
|
59
50
|
|
60
51
|
Rails/MatchRoute:
|
61
|
-
Reference: 'We have no reference for this change'
|
62
52
|
Enabled: true
|
63
53
|
|
64
54
|
Rails/NegateInclude:
|
65
|
-
Reference: 'We have no reference for this change'
|
66
55
|
Enabled: true
|
67
56
|
|
68
57
|
Rails/Pluck:
|
69
|
-
Reference: 'We have no reference for this change'
|
70
58
|
Enabled: true
|
71
59
|
|
72
60
|
Rails/PluckInWhere:
|
73
|
-
Reference: 'We have no reference for this change'
|
74
61
|
Enabled: true
|
75
62
|
|
76
63
|
Rails/RenderInline:
|
77
|
-
Reference: 'We have no reference for this change'
|
78
64
|
Enabled: true
|
79
65
|
|
80
66
|
Rails/RenderPlainText:
|
81
|
-
Reference: 'We have no reference for this change'
|
82
67
|
Enabled: true
|
83
68
|
|
84
69
|
Rails/ShortI18n:
|
85
|
-
Reference: 'We have no reference for this change'
|
86
70
|
Enabled: true
|
87
71
|
EnforcedStyle: aggressive
|
88
72
|
|
89
73
|
Rails/SquishedSQLHeredocs:
|
90
|
-
Reference: 'We have no reference for this change'
|
91
74
|
Enabled: true
|
92
75
|
|
93
76
|
Rails/WhereEquals:
|
94
|
-
Reference: 'We have no reference for this change'
|
95
77
|
Enabled: true
|
96
78
|
|
97
79
|
Rails/WhereExists:
|
98
|
-
Reference: 'We have no reference for this change'
|
99
80
|
Enabled: true
|
100
81
|
|
101
82
|
Rails/WhereNot:
|
102
|
-
Reference: 'We have no reference for this change'
|
103
83
|
Enabled: true
|
data/config/cops/rspec.yml
CHANGED
@@ -7,14 +7,12 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# RSpec/AlignLeftLetBrace:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/32'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
14
13
|
|
15
14
|
# @NOTE: added: "if", "and"
|
16
15
|
RSpec/ContextWording:
|
17
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/25'
|
18
16
|
Prefixes:
|
19
17
|
- when
|
20
18
|
- with
|
@@ -25,18 +23,15 @@ RSpec/ContextWording:
|
|
25
23
|
|
26
24
|
# @NOTE: by default, no methods are enabled
|
27
25
|
RSpec/Capybara/FeatureMethods:
|
28
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/25'
|
29
26
|
EnabledMethods:
|
30
27
|
- feature
|
31
28
|
- scenario
|
32
29
|
|
33
30
|
# @NOTE: increased from 3 to 5
|
34
31
|
RSpec/NestedGroups:
|
35
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/25'
|
36
32
|
Max: 5
|
37
33
|
|
38
34
|
|
39
35
|
# @NOTE: increased from 5 to 6
|
40
36
|
RSpec/MultipleMemoizedHelpers:
|
41
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/25'
|
42
37
|
Max: 6
|
data/config/cops/style.yml
CHANGED
@@ -7,23 +7,19 @@
|
|
7
7
|
# For example:
|
8
8
|
#
|
9
9
|
# Style/AndOr:
|
10
|
-
# Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/34'
|
11
10
|
# Enabled: true
|
12
11
|
#
|
13
12
|
|
14
13
|
# @NOTE: changed from "always" to "never"
|
15
14
|
Style/FrozenStringLiteralComment:
|
16
|
-
Reference: 'we have no reference for this change'
|
17
15
|
EnforcedStyle: never
|
18
16
|
|
19
17
|
# enforces to use 'name'.to_sym over 'name'.intern and so on
|
20
18
|
Style/StringMethods:
|
21
|
-
Reference: 'we have no reference for this change'
|
22
19
|
Enabled: true
|
23
20
|
|
24
21
|
# @NOTE: changed from "compact" to "expanded"
|
25
22
|
Style/EmptyMethod:
|
26
|
-
Reference: 'we have no reference for this change'
|
27
23
|
EnforcedStyle: expanded
|
28
24
|
SupportedStyles:
|
29
25
|
- compact
|
@@ -31,66 +27,52 @@ Style/EmptyMethod:
|
|
31
27
|
|
32
28
|
# @NOTE: allowed AllowMultipleReturnValues
|
33
29
|
Style/RedundantReturn:
|
34
|
-
Reference: 'we have no reference for this change'
|
35
30
|
Enabled: true
|
36
31
|
AllowMultipleReturnValues: true
|
37
32
|
|
38
33
|
# @NOTE: allowed AllowAsExpressionSeparator
|
39
34
|
Style/Semicolon:
|
40
|
-
Reference: 'we have no reference for this change'
|
41
35
|
Enabled: true
|
42
36
|
AllowAsExpressionSeparator: true
|
43
37
|
|
44
38
|
Style/CollectionMethods:
|
45
|
-
Reference: 'we have no reference for this change'
|
46
39
|
Enabled: true
|
47
40
|
|
48
41
|
Style/Documentation:
|
49
|
-
Reference: 'we have no reference for this change'
|
50
42
|
Enabled: false
|
51
43
|
|
52
44
|
# @NOTE: changed EnforcedStyleForMultiline from "no_comma" to "comma"
|
53
45
|
Style/TrailingCommaInArguments:
|
54
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/27'
|
55
46
|
EnforcedStyleForMultiline: comma
|
56
47
|
|
57
48
|
# @NOTE: changed EnforcedStyleForMultiline from "no_comma" to "comma"
|
58
49
|
Style/TrailingCommaInArrayLiteral:
|
59
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/24'
|
60
50
|
EnforcedStyleForMultiline: comma
|
61
51
|
|
62
52
|
# @NOTE: changed EnforcedStyleForMultiline from "no_comma" to "comma"
|
63
53
|
Style/TrailingCommaInHashLiteral:
|
64
|
-
Reference: 'https://github.com/dbl-works/rubocop-dbl/pull/24'
|
65
54
|
EnforcedStyleForMultiline: comma
|
66
55
|
|
67
56
|
#
|
68
57
|
# @NOTE: the following cops are "pending" by default
|
69
58
|
#
|
70
59
|
Style/ArgumentsForwarding:
|
71
|
-
Reference: 'we have no reference for this change'
|
72
60
|
Enabled: false
|
73
61
|
|
74
62
|
Style/CollectionCompact:
|
75
|
-
Reference: 'we have no reference for this change'
|
76
63
|
Enabled: true
|
77
64
|
|
78
65
|
Style/DocumentDynamicEvalDefinition:
|
79
|
-
Reference: 'we have no reference for this change'
|
80
66
|
Enabled: true
|
81
67
|
|
82
68
|
Style/NegatedIfElseCondition:
|
83
|
-
Reference: 'we have no reference for this change'
|
84
69
|
Enabled: true
|
85
70
|
|
86
71
|
Style/NilLambda:
|
87
|
-
Reference: 'we have no reference for this change'
|
88
72
|
Enabled: true
|
89
73
|
|
90
74
|
Style/RedundantArgument:
|
91
|
-
Reference: 'we have no reference for this change'
|
92
75
|
Enabled: true
|
93
76
|
|
94
77
|
Style/SwapValues:
|
95
|
-
Reference: 'we have no reference for this change'
|
96
78
|
Enabled: true
|
data/config/cops/types.yml
CHANGED
data/lib/rubocop_dbl/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-dbl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 'Team DBL :rocket:'
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: railties
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rubocop
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
148
|
- !ruby/object:Gem::Version
|
163
149
|
version: '0'
|
164
150
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.4.13
|
166
152
|
signing_key:
|
167
153
|
specification_version: 4
|
168
154
|
summary: RuboCop configuration for our Ruby on Rails projects
|