govuk-lint 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd42f6005b853e19d1b18c9d3e172d04faf3e9838fd8d89ec50337ebc3be5268
4
- data.tar.gz: 36525fba866dd155197497b6510e3c91ad1d31161109b9498e7cd1df3082387e
3
+ metadata.gz: ce73a0fa51ecb39ddfd07ccc95ccc7fc7a4608af35b497f1fa4a243d36c112f5
4
+ data.tar.gz: da7640ae733a8c04c06cc983f7e181ebe873ebc9c36880f5c5efbde9dcee8b13
5
5
  SHA512:
6
- metadata.gz: 200c7b4d91767ebf6390b33a72e667684e477162e093544a30a81d1e2a08ed736f01dc4354b1a23d2f981be7a2ebe271bf3274662eddd8850c1dc6377ea33bdb
7
- data.tar.gz: a530e356004865e87df0ad8c05e433d91515ef3d95f45cc710e920d289a76fd9455ec55bf946ad64cacfa3b4337c14872274084cfed1fa6da1a09a37fc67c406
6
+ metadata.gz: d169d1954da6d1ea7b4ec7d54c4c94c6dfcfb23f7bc688320574a0b278c40e7912c258d88c272ccfbac3e21f3774e394ad7f35f1f14e138e5bc4b7501277bfee
7
+ data.tar.gz: c7ef524939db25e3dd93eb6fc5825ff7b603bfdb4785efca67e7fc65d08074f0b8a15450c3b83796847528289d258517339d36b6623fab8ccd93281adf092652
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- lib = File.expand_path("../../lib", __FILE__)
3
+ lib = File.expand_path("../lib", __dir__)
4
4
  $:.unshift lib unless $:.include?(lib)
5
5
 
6
6
  require "govuk/lint/cli"
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- lib = File.expand_path("../../lib", __FILE__)
3
+ lib = File.expand_path("../lib", __dir__)
4
4
  $:.unshift lib unless $:.include?(lib)
5
5
 
6
- require 'govuk/lint/sass_cli'
7
- require 'scss_lint/logger'
6
+ require "govuk/lint/sass_cli"
7
+ require "scss_lint/logger"
8
8
 
9
9
  logger = SCSSLint::Logger.new(STDOUT)
10
10
 
@@ -2,11 +2,11 @@
2
2
  ## General
3
3
  ############
4
4
 
5
- BlockAlignment:
5
+ Layout/BlockAlignment:
6
6
  Description: 'Align block ends correctly.'
7
7
  Enabled: true
8
8
 
9
- CaseIndentation:
9
+ Layout/CaseIndentation:
10
10
  Description: Indentation of when in a case/when/[else/]end.
11
11
  Enabled: true
12
12
  EnforcedStyle: case
@@ -23,50 +23,50 @@ Style/MutableConstant:
23
23
  Description: 'Freeze mutable objects assigned to constants.'
24
24
  Enabled: true
25
25
 
26
- ElseLayout:
26
+ Lint/ElseLayout:
27
27
  Description: 'Check for odd code arrangement in an else block.'
28
28
  Enabled: true
29
29
 
30
30
  # Supports --auto-correct
31
- EmptyLineBetweenDefs:
31
+ Layout/EmptyLineBetweenDefs:
32
32
  Description: Use empty lines between defs.
33
33
  Enabled: true
34
34
  AllowAdjacentOneLineDefs: false
35
35
 
36
- EmptyLines:
36
+ Layout/EmptyLines:
37
37
  Description: "Don't use several empty lines in a row."
38
38
  Enabled: true
39
39
 
40
- EndAlignment:
40
+ Layout/EndAlignment:
41
41
  Description: 'Align ends correctly.'
42
42
  Enabled: true
43
43
 
44
- EndOfLine:
44
+ Layout/EndOfLine:
45
45
  Description: 'Use Unix-style line endings.'
46
46
  Enabled: true
47
47
 
48
48
  # Supports --auto-correct
49
- IndentationWidth:
49
+ Layout/IndentationWidth:
50
50
  Description: Use 2 spaces for indentation.
51
51
  Enabled: true
52
52
 
53
53
  # Supports --auto-correct
54
- IndentationConsistency:
54
+ Layout/IndentationConsistency:
55
55
  Description: Keep indentation straight.
56
56
  Enabled: true
57
57
 
58
- LineLength:
58
+ Metrics/LineLength:
59
59
  Description: Limit lines to 80 characters.
60
60
  Enabled: false
61
61
  Max: 80
62
62
 
63
- # Supports --auto-correct
64
- SpaceAroundOperators:
63
+ # Supports --auto-correct
64
+ Layout/SpaceAroundOperators:
65
65
  Description: Use spaces around operators.
66
66
  Enabled: true
67
67
 
68
68
  # Supports --auto-correct
69
- SpaceBeforeBlockBraces:
69
+ Layout/SpaceBeforeBlockBraces:
70
70
  Description: Checks that the left block brace has or doesn't have space before it.
71
71
  Enabled: true
72
72
  EnforcedStyle: space
@@ -75,46 +75,46 @@ SpaceBeforeBlockBraces:
75
75
  - no_space
76
76
 
77
77
  # Supports --auto-correct
78
- SpaceAfterSemicolon:
78
+ Layout/SpaceAfterSemicolon:
79
79
  Description: Use spaces after semicolons.
80
80
  Enabled: true
81
81
 
82
82
  # Supports --auto-correct
83
- SpaceAfterColon:
83
+ Layout/SpaceAfterColon:
84
84
  Description: Use spaces after colons.
85
85
  Enabled: true
86
86
 
87
87
  # Supports --auto-correct
88
- SpaceAfterComma:
88
+ Layout/SpaceAfterComma:
89
89
  Description: Use spaces after commas.
90
90
  Enabled: true
91
91
 
92
92
  # Supports --auto-correct
93
- SpaceInsideReferenceBrackets:
93
+ Layout/SpaceInsideReferenceBrackets:
94
94
  Description: No spaces after array[ or before ].
95
95
  Enabled: true
96
96
 
97
97
  # Supports --auto-correct
98
- SpaceInsideArrayLiteralBrackets:
98
+ Layout/SpaceInsideArrayLiteralBrackets:
99
99
  Description: No spaces after array = [ or before ].
100
100
  Enabled: true
101
101
 
102
102
  # Supports --auto-correct
103
- SpaceInsideParens:
103
+ Layout/SpaceInsideParens:
104
104
  Description: No spaces after ( or before ).
105
105
  Enabled: true
106
106
 
107
- Tab:
107
+ Layout/Tab:
108
108
  Description: No hard tabs.
109
109
  Enabled: true
110
110
 
111
111
  # Supports --auto-correct
112
- TrailingWhitespace:
112
+ Layout/TrailingWhitespace:
113
113
  Description: Avoid trailing whitespace.
114
114
  Enabled: true
115
115
 
116
116
  # Supports --auto-correct
117
- TrailingBlankLines:
117
+ Layout/TrailingBlankLines:
118
118
  Description: Checks trailing blank lines and final newline.
119
119
  Enabled: true
120
120
  EnforcedStyle: final_newline
@@ -125,16 +125,16 @@ TrailingBlankLines:
125
125
  ## Syntax
126
126
 
127
127
  # Supports --auto-correct
128
- AndOr:
128
+ Style/AndOr:
129
129
  Description: Use &&/|| instead of and/or.
130
130
  Enabled: true
131
131
 
132
132
  # Supports --auto-correct
133
- DefWithParentheses:
133
+ Style/DefWithParentheses:
134
134
  Description: Use def with parentheses when there are arguments.
135
135
  Enabled: true
136
136
 
137
- For:
137
+ Style/For:
138
138
  Description: Checks use of for or each in multiline loops.
139
139
  Enabled: true
140
140
  EnforcedStyle: each
@@ -142,62 +142,58 @@ For:
142
142
  - for
143
143
  - each
144
144
 
145
- IfUnlessModifier:
145
+ Style/IfUnlessModifier:
146
146
  Description: Favor modifier if/unless usage when you have a single-line body.
147
147
  Enabled: false
148
148
 
149
- Metrics:
150
- LineLength:
151
- Max: 80
152
-
153
- MethodCalledOnDoEndBlock:
149
+ Style/MethodCalledOnDoEndBlock:
154
150
  Description: Avoid chaining a method call on a do...end block.
155
151
  Enabled: true
156
152
 
157
- MethodCallWithoutArgsParentheses:
153
+ Style/MethodCallWithoutArgsParentheses:
158
154
  Description: 'Do not use parentheses for method calls with no arguments.'
159
155
  Enabled: true
160
156
 
161
- MultilineBlockChain:
157
+ Style/MultilineBlockChain:
162
158
  Description: Avoid multi-line chains of blocks.
163
159
  Enabled: true
164
160
 
165
- MultilineIfThen:
161
+ Style/MultilineIfThen:
166
162
  Description: Never use then for multi-line if/unless.
167
163
  Enabled: true
168
164
 
169
- MultilineTernaryOperator:
165
+ Style/MultilineTernaryOperator:
170
166
  Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
171
167
  Enabled: true
172
168
 
173
- NestedTernaryOperator:
169
+ Style/NestedTernaryOperator:
174
170
  Description: Use one expression per branch in a ternary operator.
175
171
  Enabled: true
176
172
 
177
- OneLineConditional:
173
+ Style/OneLineConditional:
178
174
  Description: Favor the ternary operator(?:) over if/then/else/end constructs.
179
175
  Enabled: true
180
176
 
181
177
  # Supports --auto-correct
182
- ParenthesesAroundCondition:
178
+ Style/ParenthesesAroundCondition:
183
179
  Description: Don't use parentheses around the condition of an if/unless/while.
184
180
  Enabled: true
185
181
  AllowSafeAssignment: true
186
182
 
187
183
  # Supports --auto-correct
188
- RedundantReturn:
184
+ Style/RedundantReturn:
189
185
  Description: Don't use return where it's not required.
190
186
  Enabled: true
191
187
  AllowMultipleReturnValues: false
192
188
 
193
189
  # Supports --auto-correct
194
- SpaceAfterMethodName:
190
+ Layout/SpaceAfterMethodName:
195
191
  Description: Never put a space between a method name and the opening parenthesis in
196
192
  a method definition.
197
193
  Enabled: true
198
194
 
199
195
  # Supports --auto-correct
200
- SpaceAroundEqualsInParameterDefault:
196
+ Layout/SpaceAroundEqualsInParameterDefault:
201
197
  Description: Checks that the equals signs in parameter default assignments have or
202
198
  don't have surrounding space depending on configuration.
203
199
  Enabled: true
@@ -206,35 +202,35 @@ SpaceAroundEqualsInParameterDefault:
206
202
  - space
207
203
  - no_space
208
204
 
209
- UnlessElse:
205
+ Style/UnlessElse:
210
206
  Description: Never use unless with else. Rewrite these with the positive case first.
211
207
  Enabled: true
212
208
 
213
209
  # Supports --auto-correct
214
- UnusedBlockArgument:
210
+ Lint/UnusedBlockArgument:
215
211
  Description: Checks for unused block arguments.
216
212
  Enabled: true
217
213
 
218
214
  ## Naming
219
215
 
220
- ClassAndModuleCamelCase:
216
+ Naming/ClassAndModuleCamelCase:
221
217
  Description: Use CamelCase for classes and modules.
222
218
  Enabled: true
223
219
 
224
220
  # Supports --auto-correct
225
- ClassMethods:
221
+ Style/ClassMethods:
226
222
  Description: Use self when defining module/class methods.
227
223
  Enabled: true
228
224
 
229
- ClassVars:
225
+ Style/ClassVars:
230
226
  Description: Avoid the use of class variables.
231
227
  Enabled: true
232
228
 
233
- ConstantName:
229
+ Naming/ConstantName:
234
230
  Description: Constants should use SCREAMING_SNAKE_CASE.
235
231
  Enabled: true
236
232
 
237
- MethodName:
233
+ Naming/MethodName:
238
234
  Description: Use the configured style when naming methods.
239
235
  Enabled: true
240
236
  EnforcedStyle: snake_case
@@ -243,7 +239,7 @@ MethodName:
243
239
  - camelCase
244
240
 
245
241
  # Supports --auto-correct
246
- TrivialAccessors:
242
+ Style/TrivialAccessors:
247
243
  Description: Prefer attr_* methods to trivial readers/writers.
248
244
  Enabled: true
249
245
  ExactNameMatch: true
@@ -268,7 +264,7 @@ TrivialAccessors:
268
264
  - to_s
269
265
  - to_sym
270
266
 
271
- VariableName:
267
+ Naming/VariableName:
272
268
  Description: Use the configured style when naming variables.
273
269
  Enabled: true
274
270
  EnforcedStyle: snake_case
@@ -279,19 +275,19 @@ VariableName:
279
275
  ## Exceptions
280
276
 
281
277
  # Supports --auto-correct
282
- RescueException:
278
+ Lint/RescueException:
283
279
  Description: Avoid rescuing the Exception class.
284
280
  Enabled: true
285
281
 
286
282
  ## Collections
287
283
 
288
284
  # Supports --auto-correct
289
- AlignArray:
285
+ Layout/AlignArray:
290
286
  Description: Align the elements of an array literal if they span more than one line.
291
287
  Enabled: true
292
288
 
293
289
  # Supports --auto-correct
294
- HashSyntax:
290
+ Style/HashSyntax:
295
291
  Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1,
296
292
  :b => 2 }.'
297
293
  Enabled: true
@@ -303,36 +299,36 @@ HashSyntax:
303
299
  - ruby19
304
300
  - hash_rockets
305
301
 
306
- TrailingCommaInArrayLiteral:
302
+ Style/TrailingCommaInArrayLiteral:
307
303
  Enabled: true
308
304
  EnforcedStyleForMultiline: comma
309
305
 
310
- TrailingCommaInHashLiteral:
306
+ Style/TrailingCommaInHashLiteral:
311
307
  Enabled: true
312
308
  EnforcedStyleForMultiline: comma
313
309
 
314
- TrailingCommaInArguments:
310
+ Style/TrailingCommaInArguments:
315
311
  Enabled: true
316
312
  EnforcedStyleForMultiline: comma
317
313
 
318
314
  # Supports --auto-correct
319
- WordArray:
315
+ Style/WordArray:
320
316
  Description: Use %w or %W for arrays of words.
321
317
  Enabled: true
322
318
  MinSize: 0
323
319
 
324
- MultilineMethodCallIndentation:
320
+ Layout/MultilineMethodCallIndentation:
325
321
  Enabled: false
326
322
 
327
323
  ## Strings
328
324
 
329
325
  # Supports --auto-correct
330
- StringConversionInInterpolation:
326
+ Lint/StringConversionInInterpolation:
331
327
  Description: Checks for Object#to_s usage in string interpolation.
332
328
  Enabled: true
333
329
 
334
330
  # Supports --auto-correct
335
- StringLiterals:
331
+ Style/StringLiterals:
336
332
  Description: Checks if uses of quotes match the configured preference.
337
333
  Enabled: true
338
334
  EnforcedStyle: double_quotes
@@ -1,129 +1,129 @@
1
- AmbiguousOperator:
1
+ Lint/AmbiguousOperator:
2
2
  Description: >-
3
3
  Checks for ambiguous operators in the first argument of a
4
4
  method invocation without parentheses.
5
5
  Enabled: true
6
6
 
7
- AmbiguousRegexpLiteral:
7
+ Lint/AmbiguousRegexpLiteral:
8
8
  Description: >-
9
9
  Checks for ambiguous regexp literals in the first argument of
10
10
  a method invocation without parenthesis.
11
11
  Enabled: true
12
12
 
13
- AssignmentInCondition:
13
+ Lint/AssignmentInCondition:
14
14
  Description: "Don't use assignment in conditions."
15
15
  Enabled: true
16
16
 
17
- ConditionPosition:
17
+ Layout/ConditionPosition:
18
18
  Description: 'Checks for condition placed in a confusing position relative to the keyword.'
19
19
  Enabled: true
20
20
 
21
- Debugger:
21
+ Lint/Debugger:
22
22
  Description: 'Check for debugger calls.'
23
23
  Enabled: true
24
24
 
25
- DeprecatedClassMethods:
25
+ Lint/DeprecatedClassMethods:
26
26
  Description: 'Check for deprecated class method calls.'
27
27
  Enabled: true
28
28
 
29
- EmptyEnsure:
29
+ Lint/EmptyEnsure:
30
30
  Description: 'Checks for empty ensure block.'
31
31
  Enabled: true
32
32
 
33
- EmptyInterpolation:
33
+ Lint/EmptyInterpolation:
34
34
  Description: 'Checks for empty string interpolation.'
35
35
  Enabled: true
36
36
 
37
- EndInMethod:
37
+ Lint/EndInMethod:
38
38
  Description: 'END blocks should not be placed inside method definitions.'
39
39
  Enabled: true
40
40
 
41
- EnsureReturn:
41
+ Lint/EnsureReturn:
42
42
  Description: 'Never use return in an ensure block.'
43
43
  Enabled: true
44
44
 
45
- Eval:
45
+ Security/Eval:
46
46
  Description: 'The use of eval represents a serious security risk.'
47
47
  Enabled: true
48
48
 
49
- HandleExceptions:
49
+ Lint/HandleExceptions:
50
50
  Description: "Don't suppress exception."
51
51
  Enabled: true
52
52
 
53
- LiteralAsCondition:
53
+ Lint/LiteralAsCondition:
54
54
  Description: 'Checks of literals used in conditions.'
55
55
  Enabled: true
56
56
 
57
- LiteralInInterpolation:
57
+ Lint/LiteralInInterpolation:
58
58
  Description: 'Checks for literals used in interpolation.'
59
59
  Enabled: true
60
60
 
61
- Loop:
61
+ Lint/Loop:
62
62
  Description: >-
63
63
  Use Kernel#loop with break rather than begin/end/until or
64
64
  begin/end/while for post-loop tests.
65
65
  Enabled: true
66
66
 
67
- ParenthesesAsGroupedExpression:
67
+ Lint/ParenthesesAsGroupedExpression:
68
68
  Description: >-
69
69
  Checks for method calls with a space before the opening
70
70
  parenthesis.
71
71
  Enabled: true
72
72
 
73
- PercentStringArray:
73
+ Lint/PercentStringArray:
74
74
  Description: Checks for unwanted commas and quotes in %w/%W literals eg %w('foo', “bar”).
75
75
  Enabled: true
76
76
 
77
- RequireParentheses:
77
+ Lint/RequireParentheses:
78
78
  Description: >-
79
79
  Use parentheses in the method call to avoid confusion
80
80
  about precedence.
81
81
  Enabled: true
82
82
 
83
- ShadowingOuterLocalVariable:
83
+ Lint/ShadowingOuterLocalVariable:
84
84
  Description: >-
85
85
  Do not use the same name as outer local variable
86
86
  for block arguments or block local variables.
87
87
  Enabled: true
88
88
 
89
- SpaceBeforeFirstArg:
89
+ Layout/SpaceBeforeFirstArg:
90
90
  Description: >-
91
91
  Put a space between a method name and the first argument
92
92
  in a method call without parentheses.
93
93
  Enabled: true
94
94
 
95
- UnderscorePrefixedVariableName:
95
+ Lint/UnderscorePrefixedVariableName:
96
96
  Description: 'Do not use prefix `_` for a variable that is used.'
97
97
  Enabled: true
98
98
 
99
- UnusedMethodArgument:
99
+ Lint/UnusedMethodArgument:
100
100
  Description: 'Checks for unused method arguments.'
101
101
  Enabled: true
102
102
 
103
- UnreachableCode:
103
+ Lint/UnreachableCode:
104
104
  Description: 'Unreachable code.'
105
105
  Enabled: true
106
106
 
107
- UselessAccessModifier:
107
+ Lint/UselessAccessModifier:
108
108
  Description: 'Checks for useless access modifiers.'
109
109
  Enabled: true
110
110
 
111
- UselessAssignment:
111
+ Lint/UselessAssignment:
112
112
  Description: 'Checks for useless assignment to a local variable.'
113
113
  Enabled: true
114
114
 
115
- UselessComparison:
115
+ Lint/UselessComparison:
116
116
  Description: 'Checks for comparison of something with itself.'
117
117
  Enabled: true
118
118
 
119
- UselessElseWithoutRescue:
119
+ Lint/UselessElseWithoutRescue:
120
120
  Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
121
121
  Enabled: true
122
122
 
123
- UselessSetterCall:
123
+ Lint/UselessSetterCall:
124
124
  Description: 'Checks for useless setter call to a local variable.'
125
125
  Enabled: true
126
126
 
127
- Void:
127
+ Lint/Void:
128
128
  Description: 'Possible use of operator/literal/variable in void context.'
129
129
  Enabled: true
@@ -5,34 +5,34 @@
5
5
  Rails:
6
6
  Enabled: false
7
7
 
8
- ActionFilter:
8
+ Rails/ActionFilter:
9
9
  Description: 'Enforces consistent use of action filter methods.'
10
10
  Enabled: false
11
11
 
12
- Delegate:
12
+ Rails/Delegate:
13
13
  Description: 'Prefer delegate method for delegations.'
14
14
  Enabled: false
15
15
 
16
- HasAndBelongsToMany:
16
+ Rails/HasAndBelongsToMany:
17
17
  Description: 'Prefer has_many :through to has_and_belongs_to_many.'
18
18
  Enabled: false
19
19
 
20
- Output:
20
+ Rails/Output:
21
21
  Description: 'Checks for calls to puts, print, etc.'
22
22
  Enabled: false
23
23
 
24
- ReadWriteAttribute:
24
+ Rails/ReadWriteAttribute:
25
25
  Description: 'Checks for read_attribute(:attr) and write_attribute(:attr, val).'
26
26
  Enabled: false
27
27
 
28
- ScopeArgs:
28
+ Rails/ScopeArgs:
29
29
  Description: 'Checks the arguments of ActiveRecord scopes.'
30
30
  Enabled: false
31
31
 
32
- Validation:
32
+ Rails/Validation:
33
33
  Description: 'Use sexy validations.'
34
34
  Enabled: false
35
35
 
36
- SkipsModelValidations:
36
+ Rails/SkipsModelValidations:
37
37
  Description: 'Avoid methods that skip model validations.'
38
38
  Enabled: false
@@ -1,287 +1,287 @@
1
- AccessModifierIndentation:
1
+ Layout/AccessModifierIndentation:
2
2
  Description: Check indentation of private/protected visibility modifiers.
3
3
  Enabled: true
4
4
  EnforcedStyle: outdent
5
5
 
6
- AccessorMethodName:
6
+ Naming/AccessorMethodName:
7
7
  Description: Check the naming of accessor methods for get_/set_.
8
8
  Enabled: false
9
9
 
10
- Alias:
10
+ Style/Alias:
11
11
  Description: 'Use alias_method instead of alias.'
12
12
  Enabled: false
13
13
 
14
- AlignHash:
14
+ Layout/AlignHash:
15
15
  Description: >-
16
16
  Align the elements of a hash literal if they span more than
17
17
  one line.
18
18
  Enabled: false
19
19
 
20
- AlignParameters:
20
+ Layout/AlignParameters:
21
21
  Description: >-
22
22
  Align the parameters of a method call if they span more
23
23
  than one line.
24
24
  Enabled: false
25
25
 
26
- ArrayJoin:
26
+ Style/ArrayJoin:
27
27
  Description: 'Use Array#join instead of Array#*.'
28
28
  Enabled: false
29
29
 
30
- AsciiComments:
30
+ Style/AsciiComments:
31
31
  Description: 'Use only ascii symbols in comments.'
32
32
  Enabled: false
33
33
 
34
- AsciiIdentifiers:
34
+ Naming/AsciiIdentifiers:
35
35
  Description: 'Use only ascii symbols in identifiers.'
36
36
  Enabled: false
37
37
 
38
- Attr:
38
+ Style/Attr:
39
39
  Description: 'Checks for uses of Module#attr.'
40
40
  Enabled: false
41
41
 
42
- BeginBlock:
42
+ Style/BeginBlock:
43
43
  Description: 'Avoid the use of BEGIN blocks.'
44
44
  Enabled: false
45
45
 
46
- BlockComments:
46
+ Style/BlockComments:
47
47
  Description: 'Do not use block comments.'
48
48
  Enabled: false
49
49
 
50
- BlockNesting:
50
+ Metrics/BlockNesting:
51
51
  Description: 'Avoid excessive block nesting'
52
52
  Enabled: false
53
53
 
54
- BlockDelimiters:
54
+ Style/BlockDelimiters:
55
55
  Description: >-
56
56
  Avoid using {...} for multi-line blocks (multiline chaining is
57
57
  always ugly).
58
58
  Prefer {...} over do...end for single-line blocks.
59
59
  Enabled: false
60
60
 
61
- BracesAroundHashParameters:
61
+ Style/BracesAroundHashParameters:
62
62
  Description: 'Enforce braces style inside hash parameters.'
63
63
  Enabled: true
64
64
 
65
- CaseEquality:
65
+ Style/CaseEquality:
66
66
  Description: 'Avoid explicit use of the case equality operator(===).'
67
67
  Enabled: false
68
68
 
69
- CharacterLiteral:
69
+ Style/CharacterLiteral:
70
70
  Description: 'Checks for uses of character literals.'
71
71
  Enabled: false
72
72
 
73
- ClassAndModuleChildren:
73
+ Style/ClassAndModuleChildren:
74
74
  Description: 'Checks style of children classes and modules.'
75
75
  Enabled: false
76
76
 
77
- ClassLength:
77
+ Metrics/ClassLength:
78
78
  Description: 'Avoid classes longer than 100 lines of code.'
79
79
  Enabled: false
80
80
 
81
- CollectionMethods:
81
+ Style/CollectionMethods:
82
82
  Description: 'Preferred collection methods.'
83
83
  Enabled: false
84
84
 
85
- ColonMethodCall:
85
+ Style/ColonMethodCall:
86
86
  Description: 'Do not use :: for method call.'
87
87
  Enabled: false
88
88
 
89
- CommentAnnotation:
89
+ Style/CommentAnnotation:
90
90
  Description: >-
91
91
  Checks formatting of special comments
92
92
  (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
93
93
  Enabled: false
94
94
 
95
- CommentIndentation:
95
+ Layout/CommentIndentation:
96
96
  Description: 'Indentation of comments.'
97
97
  Enabled: false
98
98
 
99
- CyclomaticComplexity:
99
+ Metrics/CyclomaticComplexity:
100
100
  Description: 'Avoid complex methods.'
101
101
  Enabled: false
102
102
 
103
- PreferredHashMethods:
103
+ Style/PreferredHashMethods:
104
104
  Description: 'Checks for use of deprecated Hash methods.'
105
105
  Enabled: false
106
106
 
107
- Documentation:
107
+ Style/Documentation:
108
108
  Description: 'Document classes and non-namespace modules.'
109
109
  Enabled: false
110
110
 
111
- DotPosition:
111
+ Layout/DotPosition:
112
112
  Description: 'Checks the position of the dot in multi-line method calls.'
113
113
  Enabled: false
114
114
 
115
- DoubleNegation:
115
+ Style/DoubleNegation:
116
116
  Description: 'Checks for uses of double negation (!!).'
117
117
  Enabled: false
118
118
 
119
- EachWithObject:
119
+ Style/EachWithObject:
120
120
  Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
121
121
  Enabled: false
122
122
 
123
- EmptyLinesAroundAccessModifier:
123
+ Layout/EmptyLinesAroundAccessModifier:
124
124
  Description: "Keep blank lines around access modifiers."
125
125
  Enabled: true
126
126
 
127
- EmptyLines:
127
+ Layout/EmptyLines:
128
128
  Description: "Keeps track of empty lines around expression bodies."
129
129
  Enabled: false
130
130
 
131
- EmptyLiteral:
131
+ Style/EmptyLiteral:
132
132
  Description: 'Prefer literals to Array.new/Hash.new/String.new.'
133
133
  Enabled: false
134
134
 
135
- Encoding:
135
+ Style/Encoding:
136
136
  Description: 'Use UTF-8 as the source file encoding.'
137
137
  Enabled: false
138
138
 
139
- EndBlock:
139
+ Style/EndBlock:
140
140
  Description: 'Avoid the use of END blocks.'
141
141
  Enabled: false
142
142
 
143
- EvenOdd:
143
+ Style/EvenOdd:
144
144
  Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
145
145
  Enabled: false
146
146
 
147
- FileName:
147
+ Naming/FileName:
148
148
  Description: 'Use snake_case for source file names.'
149
149
  Enabled: false
150
150
 
151
- FlipFlop:
151
+ Lint/FlipFlop:
152
152
  Description: 'Checks for flip flops'
153
153
  Enabled: false
154
154
 
155
- FormatString:
155
+ Style/FormatString:
156
156
  Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
157
157
  Enabled: false
158
158
 
159
- GlobalVars:
159
+ Style/GlobalVars:
160
160
  Description: 'Do not introduce global variables.'
161
161
  Enabled: false
162
162
 
163
- GuardClause:
163
+ Style/GuardClause:
164
164
  Description: 'Check for conditionals that can be replaced with guard clauses'
165
165
  Enabled: false
166
166
 
167
- IfWithSemicolon:
167
+ Style/IfWithSemicolon:
168
168
  Description: 'Never use if x; .... Use the ternary operator instead.'
169
169
  Enabled: false
170
170
 
171
- IndentFirstArrayElement:
171
+ Layout/IndentFirstArrayElement:
172
172
  Description: >-
173
173
  Checks the indentation of the first element in an array
174
174
  literal.
175
175
  Enabled: false
176
176
 
177
- IndentFirstHashElement:
177
+ Layout/IndentFirstHashElement:
178
178
  Description: 'Checks the indentation of the first key in a hash literal.'
179
179
  Enabled: false
180
180
 
181
- Lambda:
181
+ Style/Lambda:
182
182
  Description: 'Use the new lambda literal syntax for single-line blocks.'
183
183
  Enabled: false
184
184
 
185
- LambdaCall:
185
+ Style/LambdaCall:
186
186
  Description: 'Use lambda.call(...) instead of lambda.(...).'
187
187
  Enabled: false
188
188
 
189
- LeadingCommentSpace:
189
+ Layout/LeadingCommentSpace:
190
190
  Description: 'Comments should start with a space.'
191
191
  Enabled: false
192
192
 
193
- LineEndConcatenation:
193
+ Style/LineEndConcatenation:
194
194
  Description: >-
195
195
  Use \ instead of + or << to concatenate two string literals at
196
196
  line end.
197
197
  Enabled: false
198
198
 
199
- MethodDefParentheses:
199
+ Style/MethodDefParentheses:
200
200
  Description: >-
201
201
  Checks if the method definitions have or don't have
202
202
  parentheses.
203
203
  Enabled: false
204
204
 
205
- MethodLength:
205
+ Metrics/MethodLength:
206
206
  Description: 'Avoid methods longer than 10 lines of code.'
207
207
  Enabled: false
208
208
 
209
- ModuleFunction:
209
+ Style/ModuleFunction:
210
210
  Description: 'Checks for usage of `extend self` in modules.'
211
211
  Enabled: false
212
212
 
213
- MultilineOperationIndentation:
213
+ Layout/MultilineOperationIndentation:
214
214
  EnforcedStyle: indented
215
215
 
216
- NegatedIf:
216
+ Style/NegatedIf:
217
217
  Description: >-
218
218
  Favor unless over if for negative conditions
219
219
  (or control flow or).
220
220
  Enabled: false
221
221
 
222
- NegatedWhile:
222
+ Style/NegatedWhile:
223
223
  Description: 'Favor until over while for negative conditions.'
224
224
  Enabled: false
225
225
 
226
- Next:
226
+ Style/Next:
227
227
  Description: 'Use `next` to skip iteration instead of a condition at the end.'
228
228
  Enabled: false
229
229
 
230
- NilComparison:
230
+ Style/NilComparison:
231
231
  Description: 'Prefer x.nil? to x == nil.'
232
232
  Enabled: false
233
233
 
234
- NonNilCheck:
234
+ Style/NonNilCheck:
235
235
  Description: 'Checks for redundant nil checks.'
236
236
  Enabled: false
237
237
 
238
- Not:
238
+ Style/Not:
239
239
  Description: 'Use ! instead of not.'
240
240
  Enabled: false
241
241
 
242
- NumericLiterals:
242
+ Style/NumericLiterals:
243
243
  Description: >-
244
244
  Add underscores to large numeric literals to improve their
245
245
  readability.
246
246
  Enabled: false
247
247
 
248
- ParameterLists:
248
+ Metrics/ParameterLists:
249
249
  Description: 'Avoid parameter lists longer than three or four parameters.'
250
250
  Enabled: false
251
251
 
252
- PercentLiteralDelimiters:
252
+ Style/PercentLiteralDelimiters:
253
253
  Description: 'Use `%`-literal delimiters consistently'
254
254
  Enabled: false
255
255
 
256
- PerlBackrefs:
256
+ Style/PerlBackrefs:
257
257
  Description: 'Avoid Perl-style regex back references.'
258
258
  Enabled: false
259
259
 
260
- PredicateName:
260
+ Naming/PredicateName:
261
261
  Description: 'Check the names of predicate methods.'
262
262
  Enabled: false
263
263
 
264
- Proc:
264
+ Style/Proc:
265
265
  Description: 'Use proc instead of Proc.new.'
266
266
  Enabled: false
267
267
 
268
- RaiseArgs:
268
+ Style/RaiseArgs:
269
269
  Description: 'Checks the arguments passed to raise/fail.'
270
270
  Enabled: false
271
271
 
272
- RedundantBegin:
272
+ Style/RedundantBegin:
273
273
  Description: "Don't use begin blocks when they are not needed."
274
274
  Enabled: false
275
275
 
276
- RedundantException:
276
+ Style/RedundantException:
277
277
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
278
278
  Enabled: false
279
279
 
280
- RedundantSelf:
280
+ Style/RedundantSelf:
281
281
  Description: "Don't use self where it's not needed."
282
282
  Enabled: false
283
283
 
284
- RegexpLiteral:
284
+ Style/RegexpLiteral:
285
285
  Description: >-
286
286
  Use %r for regular expressions matching more than
287
287
  `MaxSlashes` '/' characters.
@@ -289,7 +289,7 @@ RegexpLiteral:
289
289
  `MaxSlashes` '/' character.
290
290
  Enabled: false
291
291
 
292
- RescueModifier:
292
+ Style/RescueModifier:
293
293
  Description: 'Avoid using rescue in its modifier form.'
294
294
  Enabled: false
295
295
 
@@ -299,84 +299,84 @@ Style/SafeNavigation:
299
299
  existance of the object to safe navigation (`&.`).
300
300
  Enabled: false
301
301
 
302
- SelfAssignment:
302
+ Style/SelfAssignment:
303
303
  Description: 'Checks for places where self-assignment shorthand should have been used.'
304
304
  Enabled: false
305
305
 
306
- Semicolon:
306
+ Style/Semicolon:
307
307
  Description: "Don't use semicolons to terminate expressions."
308
308
  Enabled: false
309
309
 
310
- SignalException:
310
+ Style/SignalException:
311
311
  Description: 'Checks for proper usage of fail and raise.'
312
312
  Enabled: false
313
313
 
314
- SingleLineBlockParams:
314
+ Style/SingleLineBlockParams:
315
315
  Description: 'Enforces the names of some block params.'
316
316
  Enabled: false
317
317
 
318
- SingleLineMethods:
318
+ Style/SingleLineMethods:
319
319
  Description: 'Avoid single-line methods.'
320
320
  Enabled: false
321
321
 
322
- SpaceBeforeFirstArg:
322
+ Layout/SpaceBeforeFirstArg:
323
323
  Description: >-
324
324
  Checks that exactly one space is used between a method name
325
325
  and the first argument for method calls without parentheses.
326
326
  Enabled: false
327
327
 
328
- SpaceAroundKeyword:
328
+ Layout/SpaceAroundKeyword:
329
329
  Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
330
330
  Enabled: false
331
331
 
332
- SpaceAfterNot:
332
+ Layout/SpaceAfterNot:
333
333
  Description: Tracks redundant space after the ! operator.
334
334
  Enabled: false
335
335
 
336
- SpaceBeforeComment:
336
+ Layout/SpaceBeforeComment:
337
337
  Description: >-
338
338
  Checks for missing space between code and a comment on the
339
339
  same line.
340
340
  Enabled: false
341
341
 
342
- SpaceInsideBlockBraces:
342
+ Layout/SpaceInsideBlockBraces:
343
343
  Description: >-
344
344
  Checks that block braces have or don't have surrounding space.
345
345
  For blocks taking parameters, checks that the left brace has
346
346
  or doesn't have trailing space.
347
347
  Enabled: true
348
348
 
349
- SpaceInsideHashLiteralBraces:
349
+ Layout/SpaceInsideHashLiteralBraces:
350
350
  Description: "Use spaces inside hash literal braces - or don't."
351
351
  Enabled: true
352
352
 
353
- SpecialGlobalVars:
353
+ Style/SpecialGlobalVars:
354
354
  Description: 'Avoid Perl-style global variables.'
355
355
  Enabled: false
356
356
 
357
- UnneededCapitalW:
357
+ Style/UnneededCapitalW:
358
358
  Description: 'Checks for %W when interpolation is not needed.'
359
359
  Enabled: false
360
360
 
361
- CommandLiteral:
361
+ Style/CommandLiteral:
362
362
  Description: 'Checks for %x when `` would do.'
363
363
  Enabled: false
364
364
 
365
- VariableInterpolation:
365
+ Style/VariableInterpolation:
366
366
  Description: >-
367
367
  Don't interpolate global, instance and class variables
368
368
  directly in strings.
369
369
  Enabled: false
370
370
 
371
- WhenThen:
371
+ Style/WhenThen:
372
372
  Description: 'Use when x then ... for one-line cases.'
373
373
  Enabled: false
374
374
 
375
- WhileUntilDo:
375
+ Style/WhileUntilDo:
376
376
  Description: 'Checks for redundant do after while or until.'
377
377
  Enabled: false
378
378
 
379
- WhileUntilModifier:
379
+ Style/WhileUntilModifier:
380
380
  Description: >-
381
381
  Favor modifier while/until usage when you have a
382
382
  single-line body.
@@ -2,6 +2,6 @@ require "govuk/lint/version"
2
2
 
3
3
  module Govuk
4
4
  module Lint
5
- CONFIG_PATH = File.expand_path("../../../configs", __FILE__)
5
+ CONFIG_PATH = File.expand_path("../../configs", __dir__)
6
6
  end
7
7
  end
@@ -1,14 +1,15 @@
1
- require 'tempfile'
2
- require 'yaml'
1
+ require "tempfile"
2
+ require "yaml"
3
3
 
4
4
  module Govuk
5
5
  module Lint
6
6
  class ConfigFile
7
- CONFIG_PATH = File.expand_path("../../../../configs", __FILE__)
7
+ CONFIG_PATH = File.expand_path("../../../configs", __dir__)
8
8
  BASE_CONFIG_FILE = File.join(CONFIG_PATH, "rubocop/all.yml")
9
9
 
10
10
  def config_file_path
11
11
  return BASE_CONFIG_FILE unless File.exist?(local_config_file_path)
12
+
12
13
  tempfile_for_configs.path
13
14
  end
14
15
 
@@ -16,8 +17,8 @@ module Govuk
16
17
 
17
18
  def merged_global_and_local_configs
18
19
  config = load_global_config
19
- config['inherit_from'] = absolutize_paths(config)
20
- config['inherit_from'] << local_config_file_path
20
+ config["inherit_from"] = absolutize_paths(config)
21
+ config["inherit_from"] << local_config_file_path
21
22
  config
22
23
  end
23
24
 
@@ -26,7 +27,7 @@ module Govuk
26
27
  end
27
28
 
28
29
  def absolutize_paths(config)
29
- config['inherit_from'].map do |filename|
30
+ config["inherit_from"].map do |filename|
30
31
  File.join(CONFIG_PATH, "rubocop/#{filename}")
31
32
  end
32
33
  end
@@ -37,7 +38,7 @@ module Govuk
37
38
 
38
39
  def tempfile_for_configs
39
40
  @tempfile_for_configs ||= begin
40
- file = Tempfile.new('tmp-rubocop-all.yml')
41
+ file = Tempfile.new("tmp-rubocop-all.yml")
41
42
  file.write(merged_global_and_local_configs.to_yaml)
42
43
  file.close
43
44
  file
@@ -27,6 +27,7 @@ module Govuk
27
27
  @changed_lines ||= begin
28
28
  changes = changed_files.map do |file|
29
29
  next unless File.exist?(file)
30
+
30
31
  [file, `git difftool #{commit_options} \
31
32
  -y \
32
33
  -x 'diff \
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Lint
3
- VERSION = "4.0.0".freeze
3
+ VERSION = "4.0.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
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: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake