rubocop-dbl 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/cops/layout.yml +7 -0
- data/config/cops/style.yml +4 -0
- data/config/cops/types.yml +9 -3
- data/config/dbl.yml +1 -2
- data/lib/generators/rubocop_dbl/install_generator.rb +125 -20
- data/lib/rubocop_dbl/version.rb +1 -1
- metadata +4 -5
- data/config/cops/rails.yml +0 -83
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ec53394cf1a5816713e5bf4c77e1e88649fb7a049081c253da7cb971e91463e
|
4
|
+
data.tar.gz: 9b748ef9863698f9b6db0318dc22a94cec63314b77f6a0f161e9e0da20a314ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c49572ee20abe581d8412897f5a1fea1c1b90bde6d4aded720e97e2fe8612cd23631486575fdba9d73341b5e8669741f54d9862b0a5018d0b18ee36bde47b9ca
|
7
|
+
data.tar.gz: b8e0899af2188c0634f8af1ce420a53a1b2ce07c83f32b2e03bed6e36b079c6d8af1ee82c60983fd8039f119469833bd58b9bb4a0dab9324646db36eb900e3ad
|
data/config/cops/layout.yml
CHANGED
@@ -24,3 +24,10 @@ Layout/ParameterAlignment:
|
|
24
24
|
SupportedStyles:
|
25
25
|
- with_first_parameter
|
26
26
|
- with_fixed_indentation
|
27
|
+
|
28
|
+
Layout/LineLength:
|
29
|
+
Max: 120
|
30
|
+
IgnoreCopDirectives: true
|
31
|
+
AllowedPatterns: ['\s#\s'] # allows comments to overflow the line length. E.g. for URLs
|
32
|
+
Exclude:
|
33
|
+
- 'spec/**/*'
|
data/config/cops/style.yml
CHANGED
data/config/cops/types.yml
CHANGED
@@ -11,8 +11,14 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
Sorbet/HasSigil:
|
14
|
-
MinimumStrictness:
|
14
|
+
MinimumStrictness: strict
|
15
15
|
SuggestedStrictness: strict
|
16
16
|
Exclude:
|
17
|
-
- spec/**/*
|
18
|
-
- test/**/*
|
17
|
+
- "spec/**/*"
|
18
|
+
- "test/**/*"
|
19
|
+
|
20
|
+
Sorbet/StrictSigil:
|
21
|
+
Enabled: true
|
22
|
+
Exclude:
|
23
|
+
- "spec/**/*"
|
24
|
+
- "lib/tasks/**/*"
|
data/config/dbl.yml
CHANGED
@@ -20,7 +20,7 @@ inherit_from:
|
|
20
20
|
# see: https://docs.rubocop.org/rubocop/usage/caching.html
|
21
21
|
AllCops:
|
22
22
|
UseCache: true
|
23
|
-
TargetRubyVersion: 3.
|
23
|
+
TargetRubyVersion: 3.0.0
|
24
24
|
NewCops: enable
|
25
25
|
Exclude:
|
26
26
|
- '**/tmp/**/*'
|
@@ -30,7 +30,6 @@ AllCops:
|
|
30
30
|
- 'actionmailbox/test/dummy/**/*'
|
31
31
|
- 'actiontext/test/dummy/**/*'
|
32
32
|
- '**/node_modules/**/*'
|
33
|
-
# Additional exclude files by rubocop-rails
|
34
33
|
- 'bin/**/*'
|
35
34
|
- 'config/**/*'
|
36
35
|
- 'db/**/*'
|
@@ -10,38 +10,143 @@ module RubocopDbl
|
|
10
10
|
|
11
11
|
def create_config_file
|
12
12
|
file_method = config_file_exists? ? :prepend : :create
|
13
|
-
|
14
|
-
end
|
13
|
+
content = defined?(Rails) ? config_file_content_rails : config_file_content
|
15
14
|
|
16
|
-
|
15
|
+
send(
|
16
|
+
:"#{file_method}_file",
|
17
|
+
config_file_path,
|
18
|
+
content,
|
19
|
+
)
|
20
|
+
end
|
17
21
|
|
18
|
-
def config_file_exists?
|
22
|
+
private def config_file_exists?
|
19
23
|
File.exist?(config_file_path)
|
20
24
|
end
|
21
25
|
|
22
|
-
def config_file_path
|
26
|
+
private def config_file_path
|
23
27
|
'.rubocop.yml'
|
24
28
|
end
|
25
29
|
|
26
|
-
def config_file_content
|
27
|
-
|
28
|
-
<<~HEREDOC
|
29
|
-
require:
|
30
|
-
- rubocop-rails
|
31
|
-
|
30
|
+
private def config_file_content
|
31
|
+
<<~HEREDOC
|
32
32
|
inherit_gem:
|
33
33
|
rubocop-dbl:
|
34
|
-
|
35
|
-
- config/cops/rails.yml
|
36
|
-
HEREDOC
|
37
|
-
else
|
38
|
-
<<~HEREDOC
|
34
|
+
- config/dbl.yml
|
39
35
|
|
40
|
-
|
41
|
-
|
36
|
+
# we do not want to overwrite the base-array (from rubocop-dbl), but extend it
|
37
|
+
inherit_mode:
|
38
|
+
merge:
|
39
|
+
- Exclude
|
40
|
+
|
41
|
+
AllCops:
|
42
|
+
TargetRubyVersion: 3.3.0
|
43
|
+
Exclude:
|
44
|
+
- 'sorbet/rbi/shims/**/*'
|
45
|
+
HEREDOC
|
46
|
+
end
|
47
|
+
|
48
|
+
private def config_file_content_rails
|
49
|
+
<<~HEREDOC
|
50
|
+
require:
|
51
|
+
- rubocop-rails
|
52
|
+
|
53
|
+
inherit_gem:
|
54
|
+
rubocop-dbl:
|
42
55
|
- config/dbl.yml
|
43
|
-
|
44
|
-
|
56
|
+
|
57
|
+
inherit_mode:
|
58
|
+
merge:
|
59
|
+
- Exclude
|
60
|
+
|
61
|
+
AllCops:
|
62
|
+
TargetRubyVersion: 3.3.0
|
63
|
+
Exclude:
|
64
|
+
- 'sorbet/rbi/shims/**/*'
|
65
|
+
|
66
|
+
# Defaults for this cop are found here:
|
67
|
+
# https://github.com/rubocop/rubocop-rails/blob/master/config/default.yml
|
68
|
+
#
|
69
|
+
# Add customizations below.
|
70
|
+
#
|
71
|
+
# Ensure to document why we change a default by linking the corresponding PR.
|
72
|
+
# For example:
|
73
|
+
#
|
74
|
+
# Rails/ActionFilter:
|
75
|
+
# Enabled: false
|
76
|
+
#
|
77
|
+
|
78
|
+
# @NOTE: added: "staging"
|
79
|
+
Rails/UnknownEnv:
|
80
|
+
Environments:
|
81
|
+
- production
|
82
|
+
- development
|
83
|
+
- test
|
84
|
+
- staging
|
85
|
+
|
86
|
+
# @NOTE: disabled
|
87
|
+
Rails/HttpStatus:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
# @NOTE: disabled
|
91
|
+
Rails/ApplicationController:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
|
95
|
+
#
|
96
|
+
# @NOTE: all the cops ahead are "pending" in the current default config
|
97
|
+
#
|
98
|
+
Rails/ActiveRecordCallbacksOrder:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
Rails/AfterCommitOverride:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Rails/AttributeDefaultBlockValue:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Rails/FindById:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Rails/Inquiry:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Rails/MailerName:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
Rails/MatchRoute:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Rails/NegateInclude:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Rails/Pluck:
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Rails/PluckInWhere:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Rails/RenderInline:
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
Rails/RenderPlainText:
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Rails/ShortI18n:
|
135
|
+
Enabled: true
|
136
|
+
EnforcedStyle: aggressive
|
137
|
+
|
138
|
+
Rails/SquishedSQLHeredocs:
|
139
|
+
Enabled: true
|
140
|
+
|
141
|
+
Rails/WhereEquals:
|
142
|
+
Enabled: true
|
143
|
+
|
144
|
+
Rails/WhereExists:
|
145
|
+
Enabled: true
|
146
|
+
|
147
|
+
Rails/WhereNot:
|
148
|
+
Enabled: true
|
149
|
+
HEREDOC
|
45
150
|
end
|
46
151
|
end
|
47
152
|
end
|
data/lib/rubocop_dbl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-dbl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.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: 2024-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -107,7 +107,6 @@ files:
|
|
107
107
|
- config/cops/metrics.yml
|
108
108
|
- config/cops/naming.yml
|
109
109
|
- config/cops/performance.yml
|
110
|
-
- config/cops/rails.yml
|
111
110
|
- config/cops/rspec.yml
|
112
111
|
- config/cops/style.yml
|
113
112
|
- config/cops/types.yml
|
@@ -127,14 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
126
|
requirements:
|
128
127
|
- - ">="
|
129
128
|
- !ruby/object:Gem::Version
|
130
|
-
version: '3.
|
129
|
+
version: '3.0'
|
131
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
131
|
requirements:
|
133
132
|
- - ">="
|
134
133
|
- !ruby/object:Gem::Version
|
135
134
|
version: '0'
|
136
135
|
requirements: []
|
137
|
-
rubygems_version: 3.5.
|
136
|
+
rubygems_version: 3.5.6
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: RuboCop configuration for our Ruby on Rails projects
|
data/config/cops/rails.yml
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# Defaults for this cop are found here:
|
2
|
-
# https://github.com/rubocop/rubocop-rails/blob/master/config/default.yml
|
3
|
-
#
|
4
|
-
# Add customizations below.
|
5
|
-
#
|
6
|
-
# Ensure to document why we change a default by linking the corresponding PR.
|
7
|
-
# For example:
|
8
|
-
#
|
9
|
-
# Rails/ActionFilter:
|
10
|
-
# Enabled: false
|
11
|
-
#
|
12
|
-
|
13
|
-
# @NOTE: added: "staging"
|
14
|
-
Rails/UnknownEnv:
|
15
|
-
Environments:
|
16
|
-
- production
|
17
|
-
- development
|
18
|
-
- test
|
19
|
-
- staging
|
20
|
-
|
21
|
-
# @NOTE: disabled
|
22
|
-
Rails/HttpStatus:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
# @NOTE: disabled
|
26
|
-
Rails/ApplicationController:
|
27
|
-
Enabled: false
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
# @NOTE: all the cops ahead are "pending" in the current default config
|
32
|
-
#
|
33
|
-
Rails/ActiveRecordCallbacksOrder:
|
34
|
-
Enabled: true
|
35
|
-
|
36
|
-
Rails/AfterCommitOverride:
|
37
|
-
Enabled: true
|
38
|
-
|
39
|
-
Rails/AttributeDefaultBlockValue:
|
40
|
-
Enabled: true
|
41
|
-
|
42
|
-
Rails/FindById:
|
43
|
-
Enabled: true
|
44
|
-
|
45
|
-
Rails/Inquiry:
|
46
|
-
Enabled: true
|
47
|
-
|
48
|
-
Rails/MailerName:
|
49
|
-
Enabled: true
|
50
|
-
|
51
|
-
Rails/MatchRoute:
|
52
|
-
Enabled: true
|
53
|
-
|
54
|
-
Rails/NegateInclude:
|
55
|
-
Enabled: true
|
56
|
-
|
57
|
-
Rails/Pluck:
|
58
|
-
Enabled: true
|
59
|
-
|
60
|
-
Rails/PluckInWhere:
|
61
|
-
Enabled: true
|
62
|
-
|
63
|
-
Rails/RenderInline:
|
64
|
-
Enabled: true
|
65
|
-
|
66
|
-
Rails/RenderPlainText:
|
67
|
-
Enabled: true
|
68
|
-
|
69
|
-
Rails/ShortI18n:
|
70
|
-
Enabled: true
|
71
|
-
EnforcedStyle: aggressive
|
72
|
-
|
73
|
-
Rails/SquishedSQLHeredocs:
|
74
|
-
Enabled: true
|
75
|
-
|
76
|
-
Rails/WhereEquals:
|
77
|
-
Enabled: true
|
78
|
-
|
79
|
-
Rails/WhereExists:
|
80
|
-
Enabled: true
|
81
|
-
|
82
|
-
Rails/WhereNot:
|
83
|
-
Enabled: true
|