kpn-style 0.1.8 → 0.1.9
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/.gitignore +14 -14
- data/Gemfile +4 -4
- data/LICENSE +201 -201
- data/README.md +114 -106
- data/Rakefile +1 -1
- data/kpn_style.gemspec +32 -32
- data/lib/kpn/style/version.rb +3 -3
- data/lib/kpn/style.rb +5 -5
- data/ruby-2.1.yml +107 -107
- data/ruby-2.4-strict.yml +107 -107
- data/ruby-2.4.yml +109 -109
- data/ruby-2.5.yml +268 -320
- data/ruby-2.7.yml +554 -0
- metadata +12 -11
data/ruby-2.7.yml
ADDED
@@ -0,0 +1,554 @@
|
|
1
|
+
---
|
2
|
+
require: rubocop-rspec
|
3
|
+
AllCops:
|
4
|
+
DisplayCopNames: true
|
5
|
+
TargetRubyVersion: '2.7'
|
6
|
+
Include:
|
7
|
+
- "**/*.rb"
|
8
|
+
Exclude:
|
9
|
+
- bin/*
|
10
|
+
- ".vendor/**/*"
|
11
|
+
- Gemfile
|
12
|
+
- Rakefile
|
13
|
+
- pkg/**/*
|
14
|
+
- spec/fixtures/**/*
|
15
|
+
- vendor/**/*
|
16
|
+
|
17
|
+
Gemspec/DeprecatedAttributeAssignment:
|
18
|
+
Description: 'Checks that deprecated attribute assignments are not set in a gemspec file.'
|
19
|
+
Enabled: true
|
20
|
+
Gemspec/RequireMFA:
|
21
|
+
Description: 'Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.'
|
22
|
+
Enabled: true
|
23
|
+
Layout/LineLength:
|
24
|
+
Description: People have wide screens, use them.
|
25
|
+
Max: 240
|
26
|
+
Layout/LineContinuationLeadingSpace:
|
27
|
+
Description: >-
|
28
|
+
Use trailing spaces instead of leading spaces in strings
|
29
|
+
broken over multiple lines (by a backslash).
|
30
|
+
Enabled: true
|
31
|
+
Layout/LineContinuationSpacing:
|
32
|
+
Description: 'Checks the spacing in front of backslash in line continuations.'
|
33
|
+
Enabled: true
|
34
|
+
Layout/LineEndStringConcatenationIndentation:
|
35
|
+
Description: >-
|
36
|
+
Checks the indentation of the next line after a line that
|
37
|
+
ends with a string literal and a backslash.
|
38
|
+
Enabled: true
|
39
|
+
Layout/SpaceBeforeBrackets:
|
40
|
+
Description: 'Checks for receiver with a space before the opening brackets.'
|
41
|
+
Enabled: true
|
42
|
+
RSpec/BeforeAfterAll:
|
43
|
+
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
44
|
+
A necessary evil in acceptance testing.
|
45
|
+
Exclude:
|
46
|
+
- spec/acceptance/**/*.rb
|
47
|
+
RSpec/EmptyExampleGroup:
|
48
|
+
Description: Checks if an example group does not include any tests.
|
49
|
+
Enabled: false
|
50
|
+
RSpec/HookArgument:
|
51
|
+
Description: Prefer explicit :each argument, matching existing module's style
|
52
|
+
EnforcedStyle: each
|
53
|
+
RSpec/RepeatedDescription:
|
54
|
+
Description: Check for repeated description strings in example groups.
|
55
|
+
Enabled: false
|
56
|
+
Style/BlockDelimiters:
|
57
|
+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
|
58
|
+
be consistent then.
|
59
|
+
EnforcedStyle: braces_for_chaining
|
60
|
+
Style/ClassAndModuleChildren:
|
61
|
+
Description: Compact style reduces the required amount of indentation.
|
62
|
+
EnforcedStyle: compact
|
63
|
+
Style/EmptyElse:
|
64
|
+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
|
65
|
+
EnforcedStyle: empty
|
66
|
+
Style/FormatString:
|
67
|
+
Description: Following the main puppet project's style, prefer the % format format.
|
68
|
+
EnforcedStyle: percent
|
69
|
+
Style/FormatStringToken:
|
70
|
+
Description: Following the main puppet project's style, prefer the simpler template
|
71
|
+
tokens over annotated ones.
|
72
|
+
EnforcedStyle: template
|
73
|
+
Style/Lambda:
|
74
|
+
Description: Prefer the keyword for easier discoverability.
|
75
|
+
EnforcedStyle: literal
|
76
|
+
Style/RegexpLiteral:
|
77
|
+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
|
78
|
+
EnforcedStyle: percent_r
|
79
|
+
Style/TernaryParentheses:
|
80
|
+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
|
81
|
+
on complex expressions for better readability, but seriously consider breaking
|
82
|
+
it up.
|
83
|
+
EnforcedStyle: require_parentheses_when_complex
|
84
|
+
Style/TrailingCommaInArguments:
|
85
|
+
Description: Prefer always trailing comma on multiline argument lists. This makes
|
86
|
+
diffs, and re-ordering nicer.
|
87
|
+
EnforcedStyleForMultiline: comma
|
88
|
+
Style/TrailingCommaInArrayLiteral:
|
89
|
+
EnforcedStyleForMultiline: comma
|
90
|
+
Style/TrailingCommaInHashLiteral:
|
91
|
+
EnforcedStyleForMultiline: comma
|
92
|
+
Style/SymbolArray:
|
93
|
+
Description: Using percent style obscures symbolic intent of array's contents.
|
94
|
+
EnforcedStyle: brackets
|
95
|
+
RSpec/MessageSpies:
|
96
|
+
Description: Checks that message expectations are set using spies.
|
97
|
+
EnforcedStyle: receive
|
98
|
+
Style/CollectionMethods:
|
99
|
+
Description: Preferred collection methods.
|
100
|
+
Enabled: true
|
101
|
+
Style/MethodCalledOnDoEndBlock:
|
102
|
+
Description: Avoid chaining a method call on a do...end block.
|
103
|
+
Enabled: true
|
104
|
+
Style/StringMethods:
|
105
|
+
Description: Checks if configured preferred methods are used over non-preferred.
|
106
|
+
Enabled: true
|
107
|
+
Layout/EndOfLine:
|
108
|
+
Description: Use Unix-style line endings.
|
109
|
+
EnforcedStyle: lf
|
110
|
+
Metrics/AbcSize:
|
111
|
+
Description: >-
|
112
|
+
A calculated magnitude based on number of assignments,
|
113
|
+
branches, and conditions.
|
114
|
+
Enabled: false
|
115
|
+
Metrics/BlockLength:
|
116
|
+
Description: Avoid long blocks with many lines.
|
117
|
+
Enabled: false
|
118
|
+
Metrics/ClassLength:
|
119
|
+
Description: Avoid classes longer than 100 lines of code.
|
120
|
+
Enabled: false
|
121
|
+
Metrics/CyclomaticComplexity:
|
122
|
+
Description: >-
|
123
|
+
A complexity metric that is strongly correlated to the number
|
124
|
+
of test cases needed to validate a method.
|
125
|
+
Enabled: false
|
126
|
+
Metrics/MethodLength:
|
127
|
+
Description: Avoid methods longer than 10 lines of code.
|
128
|
+
Enabled: false
|
129
|
+
Metrics/ModuleLength:
|
130
|
+
Description: Avoid modules longer than 100 lines of code.
|
131
|
+
Enabled: false
|
132
|
+
Metrics/ParameterLists:
|
133
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
134
|
+
Enabled: false
|
135
|
+
Metrics/PerceivedComplexity:
|
136
|
+
Description: >-
|
137
|
+
A complexity metric geared towards measuring complexity for a
|
138
|
+
human reader.
|
139
|
+
Enabled: false
|
140
|
+
RSpec/DescribeClass:
|
141
|
+
Description: Check that the first argument to the top-level describe is a constant.
|
142
|
+
Enabled: false
|
143
|
+
RSpec/ExampleLength:
|
144
|
+
Description: Checks for long examples.
|
145
|
+
Enabled: false
|
146
|
+
RSpec/MessageExpectation:
|
147
|
+
Description: Checks for consistent message expectation style.
|
148
|
+
Enabled: false
|
149
|
+
RSpec/MultipleExpectations:
|
150
|
+
Description: Checks if examples contain too many `expect` calls.
|
151
|
+
Enabled: false
|
152
|
+
RSpec/NestedGroups:
|
153
|
+
Description: Checks for nested example groups.
|
154
|
+
Enabled: false
|
155
|
+
Style/AsciiComments:
|
156
|
+
Description: Use only ascii symbols in comments.
|
157
|
+
Enabled: false
|
158
|
+
Style/IfUnlessModifier:
|
159
|
+
Description: Don't force trailing if/unless for single-line conditionals
|
160
|
+
Enabled: false
|
161
|
+
Style/SymbolProc:
|
162
|
+
Description: Use symbols as procs instead of blocks when possible.
|
163
|
+
Enabled: false
|
164
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
165
|
+
Description: Keep blank lines around attribute accessors.
|
166
|
+
Enabled: true
|
167
|
+
Layout/SpaceAroundMethodCallOperator:
|
168
|
+
Description: Checks method call operators to not have spaces around them.
|
169
|
+
Enabled: true
|
170
|
+
Lint/AmbiguousAssignment:
|
171
|
+
Description: 'Checks for mistyped shorthand assignments.'
|
172
|
+
Enabled: true
|
173
|
+
Lint/AmbiguousOperatorPrecedence:
|
174
|
+
Description: >-
|
175
|
+
Checks for expressions containing multiple binary operations with
|
176
|
+
ambiguous precedence.
|
177
|
+
Enabled: true
|
178
|
+
Lint/AmbiguousRange:
|
179
|
+
Description: 'Checks for ranges with ambiguous boundaries.'
|
180
|
+
Enabled: true
|
181
|
+
Lint/ConstantOverwrittenInRescue:
|
182
|
+
Description: 'Checks for overwriting an exception with an exception result by use `rescue =>`.'
|
183
|
+
Enabled: true
|
184
|
+
Lint/DeprecatedConstants:
|
185
|
+
Description: 'Checks for deprecated constants.'
|
186
|
+
Enabled: true
|
187
|
+
Lint/DuplicateBranch:
|
188
|
+
Description: 'Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.'
|
189
|
+
Enabled: true
|
190
|
+
Lint/DuplicateMagicComment:
|
191
|
+
Description: 'Check for duplicated magic comments.'
|
192
|
+
Enabled: true
|
193
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
194
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
195
|
+
Enabled: true
|
196
|
+
Lint/EmptyBlock:
|
197
|
+
Description: 'Checks for blocks without a body.'
|
198
|
+
Enabled: true
|
199
|
+
Lint/EmptyClass:
|
200
|
+
Description: 'Checks for classes and metaclasses without a body.'
|
201
|
+
Enabled: true
|
202
|
+
Lint/EmptyInPattern:
|
203
|
+
Description: 'Checks for the presence of `in` pattern branches without a body.'
|
204
|
+
Enabled: true
|
205
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
206
|
+
Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
|
207
|
+
Enabled: true
|
208
|
+
Lint/LambdaWithoutLiteralBlock:
|
209
|
+
Description: 'Checks uses of lambda without a literal block.'
|
210
|
+
Enabled: true
|
211
|
+
Lint/NoReturnInBeginEndBlocks:
|
212
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
213
|
+
Enabled: true
|
214
|
+
Lint/NonAtomicFileOperation:
|
215
|
+
Description: 'Checks for non-atomic file operations.'
|
216
|
+
Enabled: true
|
217
|
+
Lint/NumberedParameterAssignment:
|
218
|
+
Description: 'Checks for uses of numbered parameter assignment.'
|
219
|
+
Enabled: true
|
220
|
+
Lint/OrAssignmentToConstant:
|
221
|
+
Description: 'Checks unintended or-assignment to constant.'
|
222
|
+
Enabled: true
|
223
|
+
Lint/RedundantDirGlobSort:
|
224
|
+
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
225
|
+
Enabled: true
|
226
|
+
Lint/RefinementImportMethods:
|
227
|
+
Description: 'Use `Refinement#import_methods` when using `include` or `prepend` in `refine` block.'
|
228
|
+
Enabled: true
|
229
|
+
Lint/RequireRangeParentheses:
|
230
|
+
Description: 'Checks that a range literal is enclosed in parentheses when the end of the range is at a line break.'
|
231
|
+
Enabled: true
|
232
|
+
Lint/RequireRelativeSelfPath:
|
233
|
+
Description: 'Checks for uses a file requiring itself with `require_relative`.'
|
234
|
+
Enabled: true
|
235
|
+
Lint/SymbolConversion:
|
236
|
+
Description: 'Checks for unnecessary symbol conversions.'
|
237
|
+
Enabled: true
|
238
|
+
Lint/ToEnumArguments:
|
239
|
+
Description: 'Ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
240
|
+
Enabled: true
|
241
|
+
Lint/TripleQuotes:
|
242
|
+
Description: 'Checks for useless triple quote constructs.'
|
243
|
+
Enabled: true
|
244
|
+
Lint/UnexpectedBlockArity:
|
245
|
+
Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
|
246
|
+
Enabled: true
|
247
|
+
Lint/UnmodifiedReduceAccumulator:
|
248
|
+
Description: 'Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.'
|
249
|
+
Enabled: true
|
250
|
+
Lint/UselessRuby2Keywords:
|
251
|
+
Description: 'Finds unnecessary uses of `ruby2_keywords`.'
|
252
|
+
Enabled: true
|
253
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
254
|
+
Description: This cop checks for places where binary operator has identical operands.
|
255
|
+
Enabled: true
|
256
|
+
Lint/DeprecatedOpenSSLConstant:
|
257
|
+
Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
|
258
|
+
Enabled: true
|
259
|
+
Lint/DuplicateElsifCondition:
|
260
|
+
Description: Do not repeat conditions used in if `elsif`.
|
261
|
+
Enabled: true
|
262
|
+
Lint/DuplicateRescueException:
|
263
|
+
Description: Checks that there are no repeated exceptions used in `rescue` expressions.
|
264
|
+
Enabled: true
|
265
|
+
Lint/EmptyConditionalBody:
|
266
|
+
Description: This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.
|
267
|
+
Enabled: true
|
268
|
+
Lint/FloatComparison:
|
269
|
+
Description: Checks for the presence of precise comparison of floating point numbers.
|
270
|
+
Enabled: true
|
271
|
+
Lint/MissingSuper:
|
272
|
+
Description: >-
|
273
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
274
|
+
without calls to `super`'.
|
275
|
+
Enabled: true
|
276
|
+
Lint/MixedRegexpCaptureTypes:
|
277
|
+
Description: Do not mix named captures and numbered captures in a Regexp literal.
|
278
|
+
Enabled: true
|
279
|
+
Lint/OutOfRangeRegexpRef:
|
280
|
+
Description: Checks for out of range reference for Regexp because it always returns nil.
|
281
|
+
Enabled: true
|
282
|
+
Lint/RaiseException:
|
283
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
284
|
+
Enabled: true
|
285
|
+
Lint/SelfAssignment:
|
286
|
+
Description: Checks for self-assignments.
|
287
|
+
Enabled: true
|
288
|
+
Lint/StructNewOverride:
|
289
|
+
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
|
290
|
+
Enabled: true
|
291
|
+
Lint/TopLevelReturnWithArgument:
|
292
|
+
Description: This cop detects top level return statements with argument.
|
293
|
+
Enabled: true
|
294
|
+
Lint/UnreachableLoop:
|
295
|
+
Description: This cop checks for loops that will have at most one iteration.
|
296
|
+
Enabled: true
|
297
|
+
Naming/BlockForwarding:
|
298
|
+
Description: 'Use anonymous block forwarding.'
|
299
|
+
Enabled: true
|
300
|
+
RSpec/BeEq: #
|
301
|
+
Description: 'Check for expectations where `be(...)` can replace `eq(...)`.'
|
302
|
+
Enabled: true
|
303
|
+
RSpec/BeNil: #
|
304
|
+
Description: 'Ensures a consistent style is used when matching `nil`.'
|
305
|
+
Enabled: true
|
306
|
+
RSpec/ChangeByZero:
|
307
|
+
Description: 'Prefer negated matchers over `to change.by(0)`.'
|
308
|
+
Enabled: true
|
309
|
+
RSpec/ClassCheck:
|
310
|
+
Description: 'Enforces consistent use of `be_a` or `be_kind_of`.'
|
311
|
+
Enabled: true
|
312
|
+
RSpec/ExcessiveDocstringSpacing:
|
313
|
+
Description: 'Checks for excessive whitespace in example descriptions.'
|
314
|
+
Enabled: true
|
315
|
+
RSpec/IdenticalEqualityAssertion:
|
316
|
+
Description: 'Checks for equality assertions with identical expressions on both sides.'
|
317
|
+
Enabled: true
|
318
|
+
RSpec/NoExpectationExample:
|
319
|
+
Description: 'Checks if an example contains any expectation.'
|
320
|
+
Enabled: false
|
321
|
+
RSpec/SortMetadata:
|
322
|
+
Description: 'Sort RSpec metadata alphabetically.'
|
323
|
+
Enabled: true
|
324
|
+
RSpec/SubjectDeclaration:
|
325
|
+
Description: 'Ensure that subject is defined using subject helper.'
|
326
|
+
Enabled: true
|
327
|
+
RSpec/VerifiedDoubleReference:
|
328
|
+
Description: 'Checks for consistent verified double reference style.'
|
329
|
+
Enabled: true
|
330
|
+
RSpec/Capybara/NegationMatcher:
|
331
|
+
Description: 'Enforces use of `have_no_*` or `not_to` for negated expectations.'
|
332
|
+
Enabled: true
|
333
|
+
RSpec/Capybara/SpecificActions:
|
334
|
+
Description: 'Checks for there is a more specific actions offered by Capybara.'
|
335
|
+
Enabled: true
|
336
|
+
RSpec/Capybara/SpecificFinders:
|
337
|
+
Description: 'Checks if there is a more specific finder offered by Capybara.'
|
338
|
+
Enabled: true
|
339
|
+
RSpec/Capybara/SpecificMatcher:
|
340
|
+
Description: 'Checks for there is a more specific matcher offered by Capybara.'
|
341
|
+
Enabled: true
|
342
|
+
RSpec/FactoryBot/ConsistentParenthesesStyle:
|
343
|
+
Description: 'Use a consistent style for parentheses in factory bot calls.'
|
344
|
+
Enabled: true
|
345
|
+
RSpec/FactoryBot/SyntaxMethods:
|
346
|
+
Description: 'Use shorthands from `FactoryBot::Syntax::Methods` in your specs.'
|
347
|
+
Enabled: true
|
348
|
+
RSpec/Rails/AvoidSetupHook:
|
349
|
+
Description: 'Checks that tests use RSpec `before` hook over Rails `setup` method.'
|
350
|
+
Enabled: true
|
351
|
+
RSpec/Rails/HaveHttpStatus:
|
352
|
+
Description: 'Checks that tests use `have_http_status` instead of equality matchers.'
|
353
|
+
Enabled: true
|
354
|
+
RSpec/Rails/InferredSpecType:
|
355
|
+
Description: 'Identifies redundant spec type.'
|
356
|
+
Enabled: true
|
357
|
+
Security/CompoundHash:
|
358
|
+
Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
|
359
|
+
Enabled: true
|
360
|
+
Security/IoMethods:
|
361
|
+
Description: >-
|
362
|
+
Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
|
363
|
+
`IO.foreach`, and `IO.readlines`.
|
364
|
+
Enabled: true
|
365
|
+
Style/ArgumentsForwarding:
|
366
|
+
Description: 'Use arguments forwarding.'
|
367
|
+
Enabled: true
|
368
|
+
Style/CollectionCompact:
|
369
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
370
|
+
Enabled: true
|
371
|
+
Style/DocumentDynamicEvalDefinition:
|
372
|
+
Description: >-
|
373
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
374
|
+
add a comment block showing its appearance if interpolated.
|
375
|
+
Enabled: true
|
376
|
+
Style/EmptyHeredoc:
|
377
|
+
Description: 'Checks for using empty heredoc to reduce redundancy.'
|
378
|
+
Enabled: true
|
379
|
+
Style/EndlessMethod:
|
380
|
+
Description: 'Avoid the use of multi-lined endless method definitions.'
|
381
|
+
Enabled: true
|
382
|
+
Style/EnvHome:
|
383
|
+
Description: "Checks for consistent usage of `ENV['HOME']`."
|
384
|
+
Enabled: true
|
385
|
+
Style/FetchEnvVar:
|
386
|
+
Description: >-
|
387
|
+
Suggests `ENV.fetch` for the replacement of `ENV[]`.
|
388
|
+
Enabled: true
|
389
|
+
Style/FileRead:
|
390
|
+
Description: 'Favor `File.(bin)read` convenience methods.'
|
391
|
+
Enabled: true
|
392
|
+
Style/FileWrite:
|
393
|
+
Description: 'Favor `File.(bin)write` convenience methods.'
|
394
|
+
Enabled: true
|
395
|
+
Style/HashConversion:
|
396
|
+
Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
|
397
|
+
Enabled: true
|
398
|
+
Style/HashExcept:
|
399
|
+
Description: >-
|
400
|
+
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
401
|
+
that can be replaced with `Hash#except` method.
|
402
|
+
Enabled: true
|
403
|
+
Style/IfWithBooleanLiteralBranches:
|
404
|
+
Description: 'Checks for redundant `if` with boolean literal branches.'
|
405
|
+
Enabled: true
|
406
|
+
Style/InPatternThen:
|
407
|
+
Description: 'Checks for `in;` uses in `case` expressions.'
|
408
|
+
Enabled: true
|
409
|
+
Style/MagicCommentFormat:
|
410
|
+
Description: 'Use a consistent style for magic comments.'
|
411
|
+
Enabled: true
|
412
|
+
Style/MapCompactWithConditionalBlock:
|
413
|
+
Description: 'Prefer `select` or `reject` over `map { ... }.compact`.'
|
414
|
+
Enabled: true
|
415
|
+
Style/MapToHash:
|
416
|
+
Description: 'Prefer `to_h` with a block over `map.to_h`.'
|
417
|
+
Enabled: true
|
418
|
+
Style/MultilineInPatternThen:
|
419
|
+
Description: 'Do not use `then` for multi-line `in` statement.'
|
420
|
+
Enabled: true
|
421
|
+
Style/NegatedIfElseCondition:
|
422
|
+
Description: >-
|
423
|
+
Checks for uses of `if-else` and ternary operators with a negated condition
|
424
|
+
which can be simplified by inverting condition and swapping branches.
|
425
|
+
Enabled: true
|
426
|
+
Style/NestedFileDirname:
|
427
|
+
Description: 'Checks for nested `File.dirname`.'
|
428
|
+
Enabled: true
|
429
|
+
Style/NilLambda:
|
430
|
+
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
431
|
+
Enabled: true
|
432
|
+
Style/NumberedParameters:
|
433
|
+
Description: 'Restrict the usage of numbered parameters.'
|
434
|
+
Enabled: true
|
435
|
+
Style/NumberedParametersLimit:
|
436
|
+
Description: 'Avoid excessive numbered params in a single block.'
|
437
|
+
Enabled: true
|
438
|
+
Style/ObjectThen:
|
439
|
+
Description: 'Enforces the use of consistent method names `Object#yield_self` or `Object#then`.'
|
440
|
+
Enabled: true
|
441
|
+
Style/OpenStructUse:
|
442
|
+
Description: >-
|
443
|
+
Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
|
444
|
+
version compatibility, and potential security issues.
|
445
|
+
Enabled: true
|
446
|
+
Style/OperatorMethodCall:
|
447
|
+
Description: 'Checks for redundant dot before operator method call.'
|
448
|
+
Enabled: true
|
449
|
+
Style/QuotedSymbols:
|
450
|
+
Description: 'Use a consistent style for quoted symbols.'
|
451
|
+
Enabled: true
|
452
|
+
Style/RedundantArgument:
|
453
|
+
Description: 'Check for a redundant argument passed to certain methods.'
|
454
|
+
Enabled: true
|
455
|
+
Style/RedundantEach:
|
456
|
+
Description: 'Checks for redundant `each`.'
|
457
|
+
Enabled: true
|
458
|
+
Style/RedundantInitialize:
|
459
|
+
Description: 'Checks for redundant `initialize` methods.'
|
460
|
+
Enabled: true
|
461
|
+
Style/RedundantSelfAssignmentBranch:
|
462
|
+
Description: 'Checks for places where conditional branch makes redundant self-assignment.'
|
463
|
+
Enabled: true
|
464
|
+
Style/RedundantStringEscape:
|
465
|
+
Description: 'Checks for redundant escapes in string literals.'
|
466
|
+
Enabled: true
|
467
|
+
Style/SelectByRegexp:
|
468
|
+
Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
|
469
|
+
Enabled: true
|
470
|
+
Style/StringChars:
|
471
|
+
Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
|
472
|
+
Enabled: true
|
473
|
+
Style/SwapValues:
|
474
|
+
Description: 'Enforces the use of shorthand-style swapping of 2 variables.'
|
475
|
+
Enabled: true
|
476
|
+
|
477
|
+
Style/AccessorGrouping:
|
478
|
+
Description: Checks for grouping of accessors in `class` and `module` bodies.
|
479
|
+
Enabled: true
|
480
|
+
Style/ArrayCoercion:
|
481
|
+
Description: >-
|
482
|
+
Use Array() instead of explicit Array check or [*var], when dealing
|
483
|
+
with a variable you want to treat as an Array, but you're not certain it's an array.
|
484
|
+
Enabled: true
|
485
|
+
Style/BisectedAttrAccessor:
|
486
|
+
Description: >-
|
487
|
+
Checks for places where `attr_reader` and `attr_writer`
|
488
|
+
for the same method can be combined into single `attr_accessor`.
|
489
|
+
Enabled: true
|
490
|
+
Style/CaseLikeIf:
|
491
|
+
Description: This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.
|
492
|
+
Enabled: true
|
493
|
+
Style/ExplicitBlockArgument:
|
494
|
+
Description: >-
|
495
|
+
Consider using explicit block argument to avoid writing block literal
|
496
|
+
that just passes its arguments to another block.
|
497
|
+
Enabled: true
|
498
|
+
Style/ExponentialNotation:
|
499
|
+
Description: When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).
|
500
|
+
Enabled: true
|
501
|
+
Style/GlobalStdStream:
|
502
|
+
Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.
|
503
|
+
Enabled: true
|
504
|
+
Style/HashAsLastArrayItem:
|
505
|
+
Description: >-
|
506
|
+
Checks for presence or absence of braces around hash literal as a last
|
507
|
+
array item depending on configuration.
|
508
|
+
Enabled: true
|
509
|
+
Style/HashEachMethods:
|
510
|
+
Description: Use Hash#each_key and Hash#each_value.
|
511
|
+
Enabled: true
|
512
|
+
Style/HashLikeCase:
|
513
|
+
Description: >-
|
514
|
+
Checks for places where `case-when` represents a simple 1:1
|
515
|
+
mapping and can be replaced with a hash lookup.
|
516
|
+
Enabled: true
|
517
|
+
Style/HashTransformKeys:
|
518
|
+
Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.
|
519
|
+
Enabled: true
|
520
|
+
Style/HashTransformValues:
|
521
|
+
Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.
|
522
|
+
Enabled: true
|
523
|
+
Style/OptionalBooleanParameter:
|
524
|
+
Description: Use keyword arguments when defining method with boolean argument.
|
525
|
+
Enabled: true
|
526
|
+
Style/RedundantAssignment:
|
527
|
+
Description: Checks for redundant assignment before returning.
|
528
|
+
Enabled: true
|
529
|
+
Style/RedundantFetchBlock:
|
530
|
+
Description: >-
|
531
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
532
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
533
|
+
Enabled: true
|
534
|
+
Style/RedundantFileExtensionInRequire:
|
535
|
+
Description: >-
|
536
|
+
Checks for the presence of superfluous `.rb` extension in
|
537
|
+
the filename provided to `require` and `require_relative`.
|
538
|
+
Enabled: true
|
539
|
+
Style/RedundantRegexpCharacterClass:
|
540
|
+
Description: Checks for unnecessary single-element Regexp character classes.
|
541
|
+
Enabled: true
|
542
|
+
Style/RedundantRegexpEscape:
|
543
|
+
Description: Checks for redundant escapes in Regexps.
|
544
|
+
Enabled: false
|
545
|
+
Style/SingleArgumentDig:
|
546
|
+
Description: Avoid using single argument dig method.
|
547
|
+
Enabled: true
|
548
|
+
Style/SlicingWithRange:
|
549
|
+
Description: Checks array slicing is done with endless ranges when suitable.
|
550
|
+
Enabled: true
|
551
|
+
Style/StringConcatenation:
|
552
|
+
Description: Checks for places where string concatenation can be replaced with string interpolation.
|
553
|
+
Enabled: true
|
554
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kpn-style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kpn
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,29 +16,29 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.38'
|
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.38'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '2.15'
|
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:
|
41
|
-
description:
|
40
|
+
version: '2.15'
|
41
|
+
description:
|
42
42
|
email:
|
43
43
|
- noreply@kpn.com
|
44
44
|
executables: []
|
@@ -58,12 +58,13 @@ files:
|
|
58
58
|
- ruby-2.4-strict.yml
|
59
59
|
- ruby-2.4.yml
|
60
60
|
- ruby-2.5.yml
|
61
|
+
- ruby-2.7.yml
|
61
62
|
homepage: https://github.com/kpn-puppet/gem-kpn-style
|
62
63
|
licenses:
|
63
64
|
- Apache-2.0
|
64
65
|
metadata:
|
65
66
|
allowed_push_host: https://rubygems.org
|
66
|
-
post_install_message:
|
67
|
+
post_install_message:
|
67
68
|
rdoc_options: []
|
68
69
|
require_paths:
|
69
70
|
- lib
|
@@ -78,8 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
79
|
- !ruby/object:Gem::Version
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
82
|
-
signing_key:
|
82
|
+
rubygems_version: 3.3.7
|
83
|
+
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: kpn style guides and shared style configs.
|
85
86
|
test_files: []
|