rubocop-govuk 3.8.0 → 3.9.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/CHANGELOG.md +20 -0
- data/config/default.yml +2 -0
- data/config/metrics.yml +9 -13
- data/config/style.yml +23 -97
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c2665fb72c667c3f07e7b9c58773452d606d6ef538eb8a72ec737db214387c
|
4
|
+
data.tar.gz: a651269b0301ba985c67ca643505becad473424dacb789cabfc0ecca51e756c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151c3d8ec8811c0f8921a4f3ce842527e0c9b677a425c17891da6e379c97b30b1f22fad6f18e4dfcfa4f65a492baea8b62060431830b057bfb83b575448318ae
|
7
|
+
data.tar.gz: 7516c91b9bc30c5565fcff0000a456c48f8adecd3fcc74f4675bd0f6172798d5fa5d70402b7f92b502b45d0af196ca782a438ef71753e4cbd4907fe622a61d71
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# 3.9.0
|
2
|
+
|
3
|
+
* Enable Style/Alias (#60)
|
4
|
+
* Enable Style/AsciiComments (#60)
|
5
|
+
* Enable Style/BlockDelimiters (#60)
|
6
|
+
* Enable Style/CaseEquality (#60)
|
7
|
+
* Enable Style/PreferredHashMethods (#60)
|
8
|
+
* Enable Style/DoubleNegation (#60)
|
9
|
+
* Enable Style/FormatString (#60)
|
10
|
+
* Enable Style/Encoding (#64)
|
11
|
+
* Enable Style/IfWithSemicolon (#64)
|
12
|
+
* Enable Style/Lambda (#64)
|
13
|
+
* Enable Style/LambdaCall (#64)
|
14
|
+
* Enable Style/ModuleFunction (#64)
|
15
|
+
* Enable Style/NilComparison (#64)
|
16
|
+
* Enable Style/SignalException (#64)
|
17
|
+
* Enable Style/SingleLineMethods (#64)
|
18
|
+
* Enable Style/CommandLiteral (#64)
|
19
|
+
* Disable Metrics/BlockLength (#65, #68)
|
20
|
+
|
1
21
|
# 3.8.0
|
2
22
|
|
3
23
|
* Enable check for flip-flops (#55)
|
data/config/default.yml
CHANGED
data/config/metrics.yml
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
1
|
+
# Analog of: 736b3d295f88b9ba6676fc168b823535582388c2
|
2
|
+
#
|
3
|
+
# We should avoid cops that are based on heuristics, since
|
4
|
+
# it's not clear what action to take to fix an issue.
|
5
|
+
#
|
6
|
+
# For this Cop, there are also several kinds of file that
|
7
|
+
# have long blocks by convention (tests, config, rake tasks,
|
8
|
+
# gemspecs), to the point where its value is dubious.
|
9
9
|
Metrics/BlockLength:
|
10
|
-
Enabled:
|
11
|
-
Exclude:
|
12
|
-
- test/**/*
|
13
|
-
- "**/spec/**/*"
|
14
|
-
ExcludedMethods: ["namespace"]
|
10
|
+
Enabled: false
|
15
11
|
|
16
12
|
# Introduced in: 736b3d295f88b9ba6676fc168b823535582388c2
|
17
13
|
# "Disable opinionated cops"
|
data/config/style.yml
CHANGED
@@ -80,38 +80,31 @@ Style/StringLiterals:
|
|
80
80
|
Style/FormatStringToken:
|
81
81
|
Enabled: false
|
82
82
|
|
83
|
-
#
|
84
|
-
#
|
83
|
+
# This is a contentious issue, since 'alias_method' works in
|
84
|
+
# all circumstances, whereas 'alias' only works lexically. As
|
85
|
+
# with single vs. double quotes, it seems pointless to expend
|
86
|
+
# effort deciding between them. Our predominant style is to use
|
87
|
+
# 'alias_method', which always works.
|
85
88
|
Style/Alias:
|
86
|
-
|
87
|
-
Enabled: false
|
89
|
+
EnforcedStyle: prefer_alias_method
|
88
90
|
|
89
|
-
#
|
90
|
-
#
|
91
|
+
# This prevents weird characters in comments, such as stylistic
|
92
|
+
# quote characters and strange whitespace. We should only allow
|
93
|
+
# special characters when they are essential for a comment. It's
|
94
|
+
# a waste of effort to go and find the special sequence when an
|
95
|
+
# alternative exists e.g. '×' can be replaced with '*' in maths.
|
91
96
|
Style/AsciiComments:
|
92
|
-
|
93
|
-
Enabled: false
|
97
|
+
AllowedChars: ['£']
|
94
98
|
|
95
|
-
#
|
96
|
-
#
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
#
|
102
|
-
# TODO: unclear why this is here!
|
99
|
+
# We should only use braces in multiline blocks in a # chained
|
100
|
+
# method call. This is consistent with the RSpec 'expect' syntax.
|
101
|
+
#
|
102
|
+
# expect {
|
103
|
+
# a_long_and_complex_method_call
|
104
|
+
# }.to raise_error(SomeError)
|
105
|
+
#
|
103
106
|
Style/BlockDelimiters:
|
104
|
-
|
105
|
-
Avoid using {...} for multi-line blocks (multiline chaining is
|
106
|
-
always ugly).
|
107
|
-
Prefer {...} over do...end for single-line blocks.
|
108
|
-
Enabled: false
|
109
|
-
|
110
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
111
|
-
# TODO: unclear why this is here!
|
112
|
-
Style/CaseEquality:
|
113
|
-
Description: 'Avoid explicit use of the case equality operator(===).'
|
114
|
-
Enabled: false
|
107
|
+
EnforcedStyle: braces_for_chaining
|
115
108
|
|
116
109
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
117
110
|
# TODO: unclear why this is here!
|
@@ -119,12 +112,6 @@ Style/ClassAndModuleChildren:
|
|
119
112
|
Description: 'Checks style of children classes and modules.'
|
120
113
|
Enabled: false
|
121
114
|
|
122
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
123
|
-
# TODO: unclear why this is here!
|
124
|
-
Style/PreferredHashMethods:
|
125
|
-
Description: 'Checks for use of deprecated Hash methods.'
|
126
|
-
Enabled: false
|
127
|
-
|
128
115
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
129
116
|
# Documenting every class is a lot of effort and we don't
|
130
117
|
# expect to get any value from this. Another risk of adding
|
@@ -134,23 +121,6 @@ Style/Documentation:
|
|
134
121
|
Description: 'Document classes and non-namespace modules.'
|
135
122
|
Enabled: false
|
136
123
|
|
137
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
138
|
-
# TODO: unclear why this is here!
|
139
|
-
Style/DoubleNegation:
|
140
|
-
Description: 'Checks for uses of double negation (!!).'
|
141
|
-
Enabled: false
|
142
|
-
|
143
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
144
|
-
# TODO: unclear why this is here!
|
145
|
-
Style/Encoding:
|
146
|
-
Description: 'Use UTF-8 as the source file encoding.'
|
147
|
-
Enabled: false
|
148
|
-
|
149
|
-
# TODO: duplicate (other-excludes.yml), remove
|
150
|
-
Style/FormatString:
|
151
|
-
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
152
|
-
Enabled: false
|
153
|
-
|
154
124
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
155
125
|
# TODO: unclear why this is here!
|
156
126
|
Style/GlobalVars:
|
@@ -167,24 +137,6 @@ Style/GuardClause:
|
|
167
137
|
Description: 'Check for conditionals that can be replaced with guard clauses'
|
168
138
|
Enabled: false
|
169
139
|
|
170
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
171
|
-
# TODO: unclear why this is here!
|
172
|
-
Style/IfWithSemicolon:
|
173
|
-
Description: 'Never use if x; .... Use the ternary operator instead.'
|
174
|
-
Enabled: false
|
175
|
-
|
176
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
177
|
-
# TODO: unclear why this is here!
|
178
|
-
Style/Lambda:
|
179
|
-
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
180
|
-
Enabled: false
|
181
|
-
|
182
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
183
|
-
# TODO: unclear why this is here!
|
184
|
-
Style/LambdaCall:
|
185
|
-
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
186
|
-
Enabled: false
|
187
|
-
|
188
140
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
189
141
|
# TODO: unclear why this is here!
|
190
142
|
Style/MethodDefParentheses:
|
@@ -193,12 +145,6 @@ Style/MethodDefParentheses:
|
|
193
145
|
parentheses.
|
194
146
|
Enabled: false
|
195
147
|
|
196
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
197
|
-
# TODO: unclear why this is here!
|
198
|
-
Style/ModuleFunction:
|
199
|
-
Description: 'Checks for usage of `extend self` in modules.'
|
200
|
-
Enabled: false
|
201
|
-
|
202
148
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
203
149
|
# TODO: unclear why this is here!
|
204
150
|
Style/NegatedIf:
|
@@ -213,12 +159,6 @@ Style/Next:
|
|
213
159
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
214
160
|
Enabled: false
|
215
161
|
|
216
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
217
|
-
# TODO: unclear why this is here!
|
218
|
-
Style/NilComparison:
|
219
|
-
Description: 'Prefer x.nil? to x == nil.'
|
220
|
-
Enabled: false
|
221
|
-
|
222
162
|
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
223
163
|
# TODO: unclear why this is here!
|
224
164
|
Style/NumericLiterals:
|
@@ -257,24 +197,10 @@ Style/SafeNavigation:
|
|
257
197
|
existance of the object to safe navigation (`&.`).
|
258
198
|
Enabled: false
|
259
199
|
|
260
|
-
#
|
261
|
-
#
|
262
|
-
Style/SignalException:
|
263
|
-
Description: 'Checks for proper usage of fail and raise.'
|
264
|
-
Enabled: false
|
265
|
-
|
266
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
267
|
-
# TODO: unclear why this is here! Suggest enabling with
|
268
|
-
# "AllowIfMethodIsEmpty: true" to accommodate Rails actions.
|
200
|
+
# We should allow for single line empty methods, as this
|
201
|
+
# is a convention for Rails controller actions.
|
269
202
|
Style/SingleLineMethods:
|
270
|
-
|
271
|
-
Enabled: false
|
272
|
-
|
273
|
-
# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
|
274
|
-
# TODO: unclear why this is here!
|
275
|
-
Style/CommandLiteral:
|
276
|
-
Description: 'Checks for %x when `` would do.'
|
277
|
-
Enabled: false
|
203
|
+
AllowIfMethodIsEmpty: true
|
278
204
|
|
279
205
|
# Introduced in: b171d652d3e434b74ddc621df3b5be24c49bc7e8
|
280
206
|
# This cop was added in preperation for a Ruby feature
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-govuk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|