rubocop-inhouse 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f1b677df9dd5811a22631b7c79c5e12bf0340ae02729b83b3c8701f46674bd37
4
+ data.tar.gz: 2a624621944532dadf0851c6a7237fef9fd51c51aca2accc5499e4f94eece0e5
5
+ SHA512:
6
+ metadata.gz: 7f4d0378fac138a136b8702b46b7788e072cfc986570817970385b3e2e0557a960d7575b72f7af26cdb9b1b53585c877b56150acc20fcc2a028f4b515aa00b45
7
+ data.tar.gz: 0ec98e487a6ba83e60cb1e9e59667a4d26792800a5a7f83b10153ead451d8911f2233219fe43aa58742f9c6b1d95036e55af07e54de10fa0e7c228ec7c309dc4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Nolan J Tait
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # RuboCop Inhouse
2
+
3
+ This repository provides recommended RuboCop configuration and additional Cops
4
+ for use on [InHouse](https://inhouse.work) open source and internal Ruby
5
+ projects, and is the home of [InHouse's Ruby Style Guide](./STYLEGUIDE.md).
6
+
7
+ We set this repository up with inspiration from
8
+ [Github's rubocop config](https://github.com/github/rubocop-github/tree/main).
9
+
10
+ ## Usage
11
+
12
+ Add `rubocop-inhouse` to your Gemfile, along with its dependencies:
13
+
14
+ ```ruby
15
+ gem "rubocop-inhouse", require: false
16
+ ```
17
+
18
+ Inherit all of the stylistic rules and cops through an inheritance declaration
19
+ in your `.rubocop.yml`:
20
+
21
+ ```yaml
22
+ # .rubocop.yml
23
+ inherit_gem:
24
+ rubocop-inhouse:
25
+ - config/default.yml # generic Ruby rules and cops
26
+ - config/rails.yml # Rails-specific rules and cops
27
+ ```
28
+
29
+ Alternatively, only require the additional custom cops in your `.rubocop.yml`
30
+ without inheriting/enabling the other stylistic rules:
31
+
32
+ ```yaml
33
+ # .rubocop.yml
34
+ require:
35
+ - rubocop-inhouse # generic Ruby cops only
36
+ - rubocop-inhouse-rails # Rails-specific cops only
37
+ ```
38
+
39
+ For more granular control over which of RuboCop's rules are enabled for your
40
+ project, both from this gem and your own configs, consider using the
41
+ `DisabledByDefault: true` option under `AllCops` in your project's
42
+ `.rubocop.yml` file. This will disable all cops by default, and you can then
43
+ explicitly enable the ones you want by setting `Enabled: true`. See [the RuboCop
44
+ docs](https://docs.rubocop.org/rubocop/configuration.html#enabled) for more
45
+ information.
data/STYLEGUIDE.md ADDED
@@ -0,0 +1 @@
1
+ TODO: Add something.
@@ -0,0 +1,29 @@
1
+ Capybara/ClickLinkOrButtonStyle:
2
+ Enabled: true
3
+
4
+ Capybara/CurrentPathExpectation:
5
+ Enabled: true
6
+
7
+ Capybara/MatchStyle:
8
+ Enabled: true
9
+
10
+ Capybara/NegationMatcher:
11
+ Enabled: true
12
+
13
+ Capybara/SpecificActions:
14
+ Enabled: true
15
+
16
+ Capybara/SpecificFinders:
17
+ Enabled: true
18
+
19
+ Capybara/SpecificMatcher:
20
+ Enabled: true
21
+
22
+ Capybara/VisibilityMatcher:
23
+ Enabled: true
24
+
25
+ Capybara/RSpec/HaveSelector:
26
+ Enabled: true
27
+
28
+ Capybara/RSpec/PredicateMatcher:
29
+ Enabled: true
@@ -0,0 +1,551 @@
1
+ require:
2
+ - rubocop-inhouse
3
+ - rubocop-performance
4
+ - rubocop-rspec
5
+ - rubocop-rake
6
+
7
+ inherit_from:
8
+ - ./rspec.yml
9
+ - ./performance.yml
10
+
11
+ Gemspec/DeprecatedAttributeAssignment:
12
+ Enabled: true
13
+
14
+ Gemspec/DevelopmentDependencies:
15
+ Enabled: true
16
+
17
+ Gemspec/RequireMFA:
18
+ Enabled: true
19
+
20
+ # ==== LAYOUT ====
21
+ Layout/BlockAlignment:
22
+ EnforcedStyleAlignWith: start_of_block
23
+
24
+ Layout/ClassStructure:
25
+ ExpectedOrder:
26
+ - module_inclusion
27
+ - constants
28
+ - association
29
+ - public_attribute_macros
30
+ - public_delegate
31
+ - macros
32
+ - initializer
33
+ - public_class_methods
34
+ - public_methods
35
+ - protected_attribute_macros
36
+ - protected_methods
37
+ - private_attribute_macros
38
+ - private_delegate
39
+ - private_methods
40
+
41
+ Layout/EndAlignment:
42
+ EnforcedStyleAlignWith: variable
43
+
44
+ Layout/FirstArgumentIndentation:
45
+ EnforcedStyle: consistent
46
+
47
+ Layout/FirstArrayElementIndentation:
48
+ EnforcedStyle: consistent
49
+
50
+ Layout/FirstArrayElementLineBreak:
51
+ Enabled: true
52
+
53
+ Layout/FirstHashElementIndentation:
54
+ EnforcedStyle: consistent
55
+
56
+ Layout/FirstHashElementLineBreak:
57
+ Enabled: true
58
+
59
+ Layout/FirstMethodArgumentLineBreak:
60
+ Enabled: true
61
+
62
+ Layout/FirstMethodParameterLineBreak:
63
+ Enabled: true
64
+
65
+ Layout/LineContinuationSpacing:
66
+ Enabled: true
67
+
68
+ Layout/LineContinuationLeadingSpace:
69
+ Enabled: true
70
+ EnforcedStyle: trailing
71
+
72
+ Layout/LineEndStringConcatenationIndentation:
73
+ Enabled: true
74
+
75
+ Layout/LineLength:
76
+ Max: 80
77
+ Exclude:
78
+ - '**/spec/**/*'
79
+ - '**/db/schema.rb'
80
+
81
+ Layout/MultilineArrayBraceLayout:
82
+ EnforcedStyle: new_line
83
+
84
+ Layout/MultilineArrayLineBreaks:
85
+ Enabled: true
86
+
87
+ Layout/MultilineOperationIndentation:
88
+ EnforcedStyle: indented
89
+
90
+ Layout/MultilineAssignmentLayout:
91
+ Enabled: true
92
+ EnforcedStyle: same_line
93
+
94
+ Layout/MultilineHashBraceLayout:
95
+ EnforcedStyle: new_line
96
+
97
+ Layout/MultilineHashKeyLineBreaks:
98
+ Enabled: true
99
+
100
+ Layout/MultilineMethodArgumentLineBreaks:
101
+ Enabled: true
102
+ AllowMultilineFinalElement: true
103
+
104
+ Layout/MultilineMethodCallBraceLayout:
105
+ EnforcedStyle: new_line
106
+
107
+ Layout/MultilineMethodCallIndentation:
108
+ EnforcedStyle: indented
109
+
110
+ Layout/SpaceAroundMethodCallOperator:
111
+ Enabled: true
112
+
113
+ Layout/MultilineMethodDefinitionBraceLayout:
114
+ EnforcedStyle: new_line
115
+
116
+ Layout/MultilineMethodParameterLineBreaks:
117
+ Enabled: true
118
+
119
+ Layout/ParameterAlignment:
120
+ EnforcedStyle: with_fixed_indentation
121
+
122
+ Layout/SingleLineBlockChain:
123
+ Enabled: true
124
+
125
+ Layout/SpaceBeforeBrackets:
126
+ Enabled: true
127
+
128
+ Layout/SpaceInLambdaLiteral:
129
+ EnforcedStyle: require_no_space
130
+
131
+ # ==== LINTING ====
132
+ Lint/AmbiguousAssignment:
133
+ Enabled: true
134
+
135
+ Lint/AmbiguousBlockAssociation:
136
+ Exclude:
137
+ - '**/spec/**/*'
138
+
139
+ Lint/AmbiguousOperatorPrecedence:
140
+ Enabled: true
141
+
142
+ Lint/AmbiguousRange:
143
+ Enabled: true
144
+
145
+ Lint/AssignmentInCondition:
146
+ Enabled: false
147
+
148
+ Lint/BinaryOperatorWithIdenticalOperands:
149
+ Enabled: true
150
+
151
+ Lint/ConstantOverwrittenInRescue:
152
+ Enabled: true
153
+
154
+ Lint/DeprecatedConstants:
155
+ Enabled: true
156
+
157
+ Lint/DuplicateBranch:
158
+ Enabled: true
159
+
160
+ Lint/DuplicateMagicComment:
161
+ Enabled: true
162
+
163
+ Lint/DuplicateMatchPattern:
164
+ Enabled: true
165
+
166
+ Lint/DuplicateRegexpCharacterClassElement:
167
+ Enabled: true
168
+
169
+ Lint/EmptyBlock:
170
+ Enabled: true
171
+
172
+ Lint/EmptyClass:
173
+ Enabled: true
174
+
175
+ Lint/EmptyInPattern:
176
+ Enabled: true
177
+
178
+ Lint/IncompatibleIoSelectWithFiberScheduler:
179
+ Enabled: true
180
+
181
+ Lint/LambdaWithoutLiteralBlock:
182
+ Enabled: true
183
+
184
+ Lint/MixedCaseRange:
185
+ Enabled: true
186
+
187
+ Lint/NoReturnInBeginEndBlocks:
188
+ Enabled: true
189
+
190
+ Lint/NonAtomicFileOperation:
191
+ Enabled: true
192
+
193
+ Lint/NumberConversion:
194
+ Enabled: true
195
+
196
+ Lint/NumberedParameterAssignment:
197
+ Enabled: true
198
+
199
+ Lint/OrAssignmentToConstant:
200
+ Enabled: true
201
+
202
+ Lint/RedundantDirGlobSort:
203
+ Enabled: true
204
+
205
+ Lint/RedundantRegexpQuantifiers:
206
+ Enabled: true
207
+
208
+ Lint/RefinementImportMethods:
209
+ Enabled: true
210
+
211
+ Lint/RequireRangeParentheses:
212
+ Enabled: true
213
+
214
+ Lint/RequireRelativeSelfPath:
215
+ Enabled: true
216
+
217
+ Lint/ShadowingOuterLocalVariable:
218
+ Enabled: false
219
+
220
+ Lint/SymbolConversion:
221
+ Enabled: true
222
+
223
+ Lint/ToEnumArguments:
224
+ Enabled: true
225
+
226
+ Lint/TripleQuotes:
227
+ Enabled: true
228
+
229
+ Lint/UnexpectedBlockArity:
230
+ Enabled: true
231
+
232
+ Lint/UnmodifiedReduceAccumulator:
233
+ Enabled: true
234
+
235
+ Lint/UnusedBlockArgument:
236
+ IgnoreEmptyBlocks: false
237
+
238
+ Lint/UnusedMethodArgument:
239
+ IgnoreEmptyMethods: false
240
+
241
+ Lint/UselessRescue:
242
+ Enabled: true
243
+
244
+ Lint/UselessRuby2Keywords:
245
+ Enabled: true
246
+
247
+ # ==== METRICS ====
248
+ Metrics/AbcSize:
249
+ Max: 20
250
+
251
+ Metrics/BlockLength:
252
+ CountComments: false
253
+ Max: 25
254
+ Exclude:
255
+ - '**/db/schema.rb'
256
+ - '**/spec/**/*'
257
+ - '**/*.rake'
258
+ - '**/factories/**/*'
259
+ - '**/config/routes.rb'
260
+
261
+ Metrics/CollectionLiteralLength:
262
+ Enabled: true
263
+
264
+ Metrics/ClassLength:
265
+ CountAsOne: ['array', 'hash']
266
+ Max: 100
267
+ Exclude:
268
+ - '**/app/controllers/**/*'
269
+
270
+ Metrics/CyclomaticComplexity:
271
+ Max: 10
272
+
273
+ Metrics/MethodLength:
274
+ CountAsOne: ['array', 'hash']
275
+ Max: 20
276
+
277
+ Metrics/ModuleLength:
278
+ CountAsOne: ['array', 'hash']
279
+ Max: 100
280
+ Exclude:
281
+ - '**/spec/**/*'
282
+
283
+ Metrics/ParameterLists:
284
+ Max: 2
285
+ CountKeywordArgs: false
286
+
287
+ Metrics/PerceivedComplexity:
288
+ Max: 8
289
+
290
+ # ==== NAMING ====
291
+ Naming/BlockForwarding:
292
+ Enabled: true
293
+ EnforcedStyle: explicit
294
+
295
+ # ==== SECURITY ====
296
+ Security/CompoundHash:
297
+ Enabled: true
298
+
299
+ Security/IoMethods:
300
+ Enabled: true
301
+
302
+ # ==== STYE ====
303
+ Style/ArgumentsForwarding:
304
+ Enabled: true
305
+
306
+ Style/ArrayCoercion:
307
+ Enabled: true
308
+
309
+ Style/ArrayIntersect:
310
+ Enabled: true
311
+
312
+ Style/AutoResourceCleanup:
313
+ Enabled: true
314
+
315
+ Style/CollectionCompact:
316
+ Enabled: true
317
+
318
+ Style/CollectionMethods:
319
+ Enabled: true
320
+
321
+ Style/ComparableClamp:
322
+ Enabled: true
323
+
324
+ Style/ConstantVisibility:
325
+ Enabled: true
326
+
327
+ Style/ConcatArrayLiterals:
328
+ Enabled: true
329
+
330
+ Style/DataInheritance:
331
+ Enabled: true
332
+
333
+ Style/DirEmpty:
334
+ Enabled: true
335
+
336
+ Style/Documentation:
337
+ Enabled: false
338
+
339
+ Style/DocumentDynamicEvalDefinition:
340
+ Enabled: true
341
+
342
+ Style/EmptyHeredoc:
343
+ Enabled: true
344
+
345
+ Style/EnvHome:
346
+ Enabled: true
347
+
348
+ Style/ExactRegexpMatch:
349
+ Enabled: true
350
+
351
+ Style/EndlessMethod:
352
+ Enabled: true
353
+ EnforcedStyle: disallow
354
+
355
+ Style/FileEmpty:
356
+ Enabled: true
357
+
358
+ Style/FileWrite:
359
+ Enabled: true
360
+
361
+ Style/FrozenStringLiteralComment:
362
+ Enabled: true
363
+ Exclude:
364
+ - "**/db/schema.rb"
365
+
366
+ Style/FetchEnvVar:
367
+ Enabled: true
368
+
369
+ Style/FileRead:
370
+ Enabled: true
371
+
372
+ Style/HashConversion:
373
+ Enabled: true
374
+
375
+ Style/HashExcept:
376
+ Enabled: true
377
+
378
+ Style/IfWithBooleanLiteralBranches:
379
+ Enabled: true
380
+
381
+ Style/ImplicitRuntimeError:
382
+ Enabled: true
383
+
384
+ Style/InPatternThen:
385
+ Enabled: true
386
+
387
+ Style/InvertibleUnlessCondition:
388
+ Enabled: true
389
+
390
+ Style/InlineComment:
391
+ Enabled: true
392
+
393
+ Style/IpAddresses:
394
+ Enabled: true
395
+
396
+ Style/Lambda:
397
+ EnforcedStyle: literal
398
+
399
+ Style/MagicCommentFormat:
400
+ Enabled: true
401
+
402
+ Style/MultilineInPatternThen:
403
+ Enabled: true
404
+
405
+ Style/MapCompactWithConditionalBlock:
406
+ Enabled: true
407
+
408
+ Style/MapToHash:
409
+ Enabled: true
410
+
411
+ Style/MapToSet:
412
+ Enabled: true
413
+
414
+ Style/MethodCallWithArgsParentheses:
415
+ Enabled: false
416
+
417
+ Style/MethodCalledOnDoEndBlock:
418
+ Enabled: true
419
+
420
+ Style/MinMaxComparison:
421
+ Enabled: true
422
+
423
+ Style/MultilineMethodSignature:
424
+ Enabled: true
425
+
426
+ Style/NegatedIfElseCondition:
427
+ Enabled: true
428
+
429
+ Style/NestedFileDirname:
430
+ Enabled: true
431
+
432
+ Style/NilLambda:
433
+ Enabled: true
434
+
435
+ Style/NumberedParameters:
436
+ Enabled: true
437
+ EnforcedStyle: disallow
438
+
439
+ Style/NumberedParametersLimit:
440
+ Enabled: true
441
+
442
+ Style/NumericLiterals:
443
+ Enabled: true
444
+ Exclude:
445
+ - '**/db/migrate/*'
446
+ - '**/db/schema.rb'
447
+
448
+ Style/ObjectThen:
449
+ Enabled: true
450
+ EnforcedStyle: then
451
+
452
+ Style/OpenStructUse:
453
+ Enabled: true
454
+
455
+ Style/OperatorMethodCall:
456
+ Enabled: true
457
+
458
+ Style/OptionHash:
459
+ Enabled: true
460
+
461
+ Style/QuotedSymbols:
462
+ Enabled: true
463
+
464
+ Style/RedundantArrayConstructor:
465
+ Enabled: true
466
+
467
+ Style/RedundantCurrentDirectoryInPath:
468
+ Enabled: true
469
+
470
+ Style/RedundantFilterChain:
471
+ Enabled: true
472
+
473
+ Style/RedundantHeredocDelimiterQuotes:
474
+ Enabled: true
475
+
476
+ Style/RedundantLineContinuation:
477
+ Enabled: true
478
+
479
+ Style/RedundantRegexpArgument:
480
+ Enabled: true
481
+
482
+ Style/RedundantRegexpConstructor:
483
+ Enabled: true
484
+
485
+ Style/RedundantSelfAssignmentBranch:
486
+ Enabled: true
487
+
488
+ Style/RedundantArgument:
489
+ Enabled: true
490
+
491
+ Style/RedundantConstantBase:
492
+ Enabled: true
493
+
494
+ Style/RedundantDoubleSplatHashBraces:
495
+ Enabled: true
496
+
497
+ Style/RedundantEach:
498
+ Enabled: true
499
+
500
+ Style/RedundantInitialize:
501
+ Enabled: true
502
+
503
+ Style/RedundantStringEscape:
504
+ Enabled: true
505
+
506
+ Style/ReturnNilInPredicateMethodDefinition:
507
+ Enabled: true
508
+
509
+ Style/SelectByRegexp:
510
+ Enabled: true
511
+
512
+ Style/SingleLineDoEndBlock:
513
+ Enabled: true
514
+
515
+ Style/StaticClass:
516
+ Enabled: true
517
+
518
+ Style/StringChars:
519
+ Enabled: true
520
+
521
+ Style/StringHashKeys:
522
+ Enabled: true
523
+ Exclude:
524
+ - "config/routes.rb"
525
+
526
+ Style/SwapValues:
527
+ Enabled: true
528
+
529
+ Style/StringLiterals:
530
+ EnforcedStyle: double_quotes
531
+
532
+ Style/StringLiteralsInInterpolation:
533
+ EnforcedStyle: double_quotes
534
+
535
+ Style/TopLevelMethodDefinition:
536
+ Enabled: true
537
+
538
+ Style/TrailingCommaInBlockArgs:
539
+ Enabled: true
540
+
541
+ Style/YAMLFileRead:
542
+ Enabled: true
543
+
544
+ Style/UnlessLogicalOperators:
545
+ Enabled: true
546
+
547
+ Style/WordArray:
548
+ Enabled: true
549
+ Exclude:
550
+ - '**/db/migrate/*'
551
+ - '**/db/schema.rb'
@@ -0,0 +1,21 @@
1
+ FactoryBot/AssociationStyle:
2
+ Enabled: true
3
+ EnforcedStyle: explicit
4
+
5
+ FactoryBot/ConsistentParenthesesStyle:
6
+ Enabled: true
7
+
8
+ FactoryBot/FactoryAssociationWithStrategy:
9
+ Enabled: true
10
+
11
+ FactoryBot/FactoryNameStyle:
12
+ Enabled: true
13
+
14
+ FactoryBot/IdSequence:
15
+ Enabled: true
16
+
17
+ FactoryBot/RedundantFactoryOption:
18
+ Enabled: true
19
+
20
+ FactoryBot/SyntaxMethods:
21
+ Enabled: true
@@ -0,0 +1,56 @@
1
+ Performance/AncestorsInclude:
2
+ Enabled: true
3
+
4
+ Performance/BigDecimalWithNumericArgument:
5
+ Enabled: true
6
+
7
+ Performance/BlockGivenWithExplicitBlock:
8
+ Enabled: true
9
+
10
+ Performance/CollectionLiteralInLoop:
11
+ Enabled: true
12
+
13
+ Performance/ConcurrentMonotonicTime:
14
+ Enabled: true
15
+
16
+ Performance/ConstantRegexp:
17
+ Enabled: true
18
+
19
+ Performance/MapCompact:
20
+ Enabled: true
21
+
22
+ Performance/MapMethodChain:
23
+ Enabled: true
24
+
25
+ Performance/MethodObjectAsBlock:
26
+ Enabled: true
27
+
28
+ Performance/RedundantEqualityComparisonBlock:
29
+ Enabled: true
30
+
31
+ Performance/RedundantSortBlock:
32
+ Enabled: true
33
+
34
+ Performance/RedundantSplitRegexpArgument:
35
+ Enabled: true
36
+
37
+ Performance/RedundantStringChars:
38
+ Enabled: true
39
+
40
+ Performance/ReverseFirst:
41
+ Enabled: true
42
+
43
+ Performance/SortReverse:
44
+ Enabled: true
45
+
46
+ Performance/Squeeze:
47
+ Enabled: true
48
+
49
+ Performance/StringIdentifierArgument:
50
+ Enabled: true
51
+
52
+ Performance/StringInclude:
53
+ Enabled: true
54
+
55
+ Performance/Sum:
56
+ Enabled: true
data/config/rails.yml ADDED
@@ -0,0 +1,231 @@
1
+ require:
2
+ - rubocop-inhouse
3
+ - rubocop-rails
4
+ - rubocop-capybara
5
+ - rubocop-factory_bot
6
+
7
+ inherit_from:
8
+ - ./capybara.yml
9
+ - ./factory_bot.yml
10
+
11
+ Layout/BlockAlignment:
12
+ Exclude:
13
+ - "**/*.erb"
14
+
15
+ Layout/IndentationWidth:
16
+ Exclude:
17
+ - "**/*.erb"
18
+
19
+ Layout/InitialIndentation:
20
+ Exclude:
21
+ - "**/*.erb"
22
+
23
+ Layout/SpaceInsideParens:
24
+ Exclude:
25
+ - "**/*.erb"
26
+
27
+ Layout/TrailingEmptyLines:
28
+ Exclude:
29
+ - "**/*.erb"
30
+
31
+ Layout/TrailingWhitespace:
32
+ Exclude:
33
+ - "**/*.erb"
34
+
35
+ Rails/ActionControllerTestCase:
36
+ Enabled: false
37
+
38
+ Rails/ActionControllerFlashBeforeRender:
39
+ Enabled: true
40
+
41
+ Rails/ActionOrder:
42
+ Enabled: true
43
+
44
+ Rails/ActiveSupportOnLoad:
45
+ Enabled: true
46
+
47
+ Rails/AddColumnIndex:
48
+ Enabled: true
49
+
50
+ Rails/AttributeDefaultBlockValue:
51
+ Enabled: true
52
+
53
+ Rails/CompactBlank:
54
+ Enabled: true
55
+
56
+ Rails/DangerousColumnNames:
57
+ Enabled: true
58
+
59
+ Rails/DeprecatedActiveModelErrorsMethods:
60
+ Enabled: true
61
+
62
+ Rails/DotSeparatedKeys:
63
+ Enabled: true
64
+
65
+ Rails/DuplicateAssociation:
66
+ Enabled: true
67
+
68
+ Rails/DuplicateScope:
69
+ Enabled: true
70
+
71
+ Rails/DurationArithmetic:
72
+ Enabled: true
73
+
74
+ Rails/EagerEvaluationLogMessage:
75
+ Enabled: true
76
+
77
+ Rails/EnvLocal:
78
+ Enabled: true
79
+
80
+ Rails/ExpandedDateRange:
81
+ Enabled: true
82
+
83
+ Rails/FreezeTime:
84
+ Enabled: true
85
+
86
+ Rails/I18nLazyLookup:
87
+ Enabled: true
88
+
89
+ Rails/I18nLocaleAssignment:
90
+ Enabled: true
91
+
92
+ Rails/I18nLocaleTexts:
93
+ Enabled: true
94
+
95
+ Rails/IgnoredColumnsAssignment:
96
+ Enabled: true
97
+
98
+ Rails/MigrationClassName:
99
+ Enabled: true
100
+
101
+ Rails/RedundantActiveRecordAllMethod:
102
+ Enabled: true
103
+
104
+ Rails/RedundantPresenceValidationOnBelongsTo:
105
+ Enabled: true
106
+
107
+ Rails/RedundantTravelBack:
108
+ Enabled: true
109
+
110
+ Rails/ResponseParsedBody:
111
+ Enabled: true
112
+
113
+ Rails/RootJoinChain:
114
+ Enabled: true
115
+
116
+ Rails/RootPublicPath:
117
+ Enabled: true
118
+
119
+ Rails/RootPathnameMethods:
120
+ Enabled: true
121
+
122
+ Rails/SquishedSQLHeredocs:
123
+ Enabled: true
124
+
125
+ Rails/StripHeredoc:
126
+ Enabled: true
127
+
128
+ Rails/ThreeStateBooleanColumn:
129
+ Enabled: true
130
+
131
+ Rails/TimeZoneAssignment:
132
+ Enabled: true
133
+
134
+ Rails/ToFormattedS:
135
+ Enabled: true
136
+
137
+ Rails/ToSWithArgument:
138
+ Enabled: true
139
+
140
+ Rails/TopLevelHashWithIndifferentAccess:
141
+ Enabled: true
142
+
143
+ Rails/TransactionExitStatement:
144
+ Enabled: true
145
+
146
+ Rails/UnusedIgnoredColumns:
147
+ Enabled: true
148
+
149
+ Rails/UnusedRenderContent:
150
+ Enabled: true
151
+
152
+ Rails/WhereEquals:
153
+ Enabled: true
154
+
155
+ Rails/WhereMissing:
156
+ Enabled: true
157
+
158
+ Rails/WhereNotWithMultipleConditions:
159
+ Enabled: true
160
+
161
+ Rails/ActionFilter:
162
+ Enabled: true
163
+
164
+ Rails/ActiveRecordCallbacksOrder:
165
+ Enabled: true
166
+
167
+ Rails/AfterCommitOverride:
168
+ Enabled: true
169
+
170
+ Rails/CreateTableWithTimestamps:
171
+ Enabled: false
172
+
173
+ Rails/Date:
174
+ Enabled: true
175
+ EnforcedStyle: strict
176
+
177
+ Rails/Delegate:
178
+ Enabled: true
179
+
180
+ Rails/DefaultScope:
181
+ Enabled: true
182
+
183
+ Rails/FindById:
184
+ Enabled: true
185
+
186
+ Rails/Inquiry:
187
+ Enabled: true
188
+
189
+ Rails/MailerName:
190
+ Enabled: true
191
+
192
+ Rails/MatchRoute:
193
+ Enabled: true
194
+
195
+ Rails/NegateInclude:
196
+ Enabled: true
197
+
198
+ Rails/OrderById:
199
+ Enabled: true
200
+
201
+ Rails/Pluck:
202
+ Enabled: true
203
+
204
+ Rails/PluckId:
205
+ Enabled: true
206
+
207
+ Rails/PluckInWhere:
208
+ Enabled: true
209
+
210
+ Rails/RenderInline:
211
+ Enabled: true
212
+
213
+ Rails/RenderPlainText:
214
+ Enabled: true
215
+
216
+ Rails/SaveBang:
217
+ Enabled: true
218
+ AllowImplicitReturn: false
219
+ Exclude:
220
+ - "spec/factories/*.rb"
221
+
222
+ Rails/ShortI18n:
223
+ Enabled: true
224
+
225
+ Rails/WhereExists:
226
+ Enabled: true
227
+
228
+ Rails/WhereNot:
229
+ Enabled: true
230
+
231
+
data/config/rspec.yml ADDED
@@ -0,0 +1,184 @@
1
+ RSpec/BeEq:
2
+ Enabled: true
3
+
4
+ RSpec/BeEmpty:
5
+ Enabled: true
6
+
7
+ RSpec/BeNil:
8
+ Enabled: true
9
+
10
+ RSpec/DuplicatedMetadata:
11
+ Enabled: true
12
+
13
+ RSpec/ChangeByZero:
14
+ Enabled: true
15
+
16
+ RSpec/ContainExactly:
17
+ Enabled: true
18
+
19
+ RSpec/EmptyMetadata:
20
+ Enabled: true
21
+
22
+ RSpec/Eq:
23
+ Enabled: true
24
+
25
+ RSpec/ExcessiveDocstringSpacing:
26
+ Enabled: true
27
+
28
+ RSpec/IdenticalEqualityAssertion:
29
+ Enabled: true
30
+
31
+ RSpec/IndexedLet:
32
+ Enabled: true
33
+
34
+ RSpec/MatchArray:
35
+ Enabled: true
36
+
37
+ RSpec/MetadataStyle:
38
+ Enabled: true
39
+
40
+ RSpec/NoExpectationExample:
41
+ Enabled: true
42
+
43
+ RSpec/PendingWithoutReason:
44
+ Enabled: true
45
+
46
+ RSpec/ReceiveMessages:
47
+ Enabled: true
48
+
49
+ RSpec/RedundantAround:
50
+ Enabled: true
51
+
52
+ RSpec/SkipBlockInsideExample:
53
+ Enabled: true
54
+
55
+ RSpec/SortMetadata:
56
+ Enabled: true
57
+
58
+ RSpec/SpecFilePathSuffix:
59
+ Enabled: true
60
+
61
+ RSpec/SubjectDeclaration:
62
+ Enabled: true
63
+
64
+ RSpec/VerifiedDoubleReference:
65
+ Enabled: true
66
+
67
+ RSpec/SpecFilePathFormat:
68
+ Enabled: true
69
+ Exclude:
70
+ - "**/spec/factories/*"
71
+ - "**/spec/components/**/*"
72
+
73
+ RSpec/MissingExampleGroupArgument:
74
+ Enabled: true
75
+ Exclude:
76
+ - '**/spec/factories/*'
77
+
78
+ RSpec/EmptyExampleGroup:
79
+ Enabled: true
80
+ Exclude:
81
+ - '**/spec/factories/*'
82
+
83
+ RSpec/AnyInstance:
84
+ Enabled: false
85
+ Exclude:
86
+ - '**/spec/factories/*'
87
+
88
+ RSpec/BeforeAfterAll:
89
+ Enabled: false
90
+ Exclude:
91
+ - '**/spec/factories/*'
92
+
93
+ RSpec/ContextWording:
94
+ Enabled: false
95
+ Exclude:
96
+ - '**/spec/factories/*'
97
+
98
+ RSpec/DescribeClass:
99
+ Enabled: false
100
+ Exclude:
101
+ - '**/spec/factories/*'
102
+
103
+ RSpec/ExampleLength:
104
+ Enabled: false
105
+ Exclude:
106
+ - '**/spec/factories/*'
107
+
108
+ RSpec/ExpectInHook:
109
+ Enabled: false
110
+ Exclude:
111
+ - '**/spec/factories/*'
112
+
113
+ RSpec/FilePath:
114
+ Enabled: false
115
+ Exclude:
116
+ - '**/spec/factories/*'
117
+
118
+ RSpec/InstanceVariable:
119
+ Enabled: false
120
+ Exclude:
121
+ - '**/spec/factories/*'
122
+
123
+ RSpec/LetSetup:
124
+ Enabled: false
125
+ Exclude:
126
+ - '**/spec/factories/*'
127
+
128
+ RSpec/MessageChain:
129
+ Enabled: false
130
+ Exclude:
131
+ - '**/spec/factories/*'
132
+
133
+ RSpec/MessageSpies:
134
+ Enabled: false
135
+ Exclude:
136
+ - '**/spec/factories/*'
137
+
138
+ RSpec/MultipleExpectations:
139
+ Enabled: false
140
+ Exclude:
141
+ - '**/spec/factories/*'
142
+
143
+ RSpec/NamedSubject:
144
+ Enabled: false
145
+ Exclude:
146
+ - '**/spec/factories/*'
147
+
148
+ RSpec/NestedGroups:
149
+ Max: 7
150
+ Exclude:
151
+ - '**/spec/factories/*'
152
+
153
+ RSpec/SubjectStub:
154
+ Enabled: false
155
+ Exclude:
156
+ - '**/spec/factories/*'
157
+
158
+ RSpec/VerifiedDoubles:
159
+ Enabled: false
160
+ Exclude:
161
+ - '**/spec/factories/*'
162
+
163
+ RSpec/VoidExpect:
164
+ Enabled: false
165
+ Exclude:
166
+ - '**/spec/factories/*'
167
+
168
+ RSpec/Rails/AvoidSetupHook:
169
+ Enabled: true
170
+
171
+ RSpec/Rails/HaveHttpStatus:
172
+ Enabled: true
173
+
174
+ RSpec/Rails/InferredSpecType:
175
+ Enabled: true
176
+
177
+ RSpec/Rails/MinitestAssertions:
178
+ Enabled: true
179
+
180
+ RSpec/Rails/NegationBeValid:
181
+ Enabled: true
182
+
183
+ RSpec/Rails/TravelAround:
184
+ Enabled: true
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubocop
4
+ module Inhouse
5
+ VERSION = "0.1.0"
6
+ public_constant :VERSION
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "inhouse/version"
4
+
5
+ module Rubocop
6
+ module Inhouse
7
+ PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
8
+ CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
9
+ CONFIG_RAILS = PROJECT_ROOT.join("config", "rails.yml").freeze
10
+
11
+ private_constant :PROJECT_ROOT
12
+ private_constant :CONFIG_DEFAULT
13
+ private_constant :CONFIG_RAILS
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+ require "rubocop/inhouse"
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+ require "rubocop/inhouse"
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-inhouse
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nolan J Tait
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-capybara
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-performance
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.6'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.2'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.2'
97
+ description: This is the rubocop configuration we use at inhouse.work for all our
98
+ projects
99
+ email:
100
+ - nolanjtait@gmail.com
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - LICENSE.txt
106
+ - README.md
107
+ - STYLEGUIDE.md
108
+ - config/capybara.yml
109
+ - config/default.yml
110
+ - config/factory_bot.yml
111
+ - config/performance.yml
112
+ - config/rails.yml
113
+ - config/rspec.yml
114
+ - lib/rubocop-inhouse-rails.rb
115
+ - lib/rubocop-inhouse.rb
116
+ - lib/rubocop/inhouse.rb
117
+ - lib/rubocop/inhouse/version.rb
118
+ homepage: https://github.com/nolantait/rubocop-inhouse
119
+ licenses:
120
+ - MIT
121
+ metadata:
122
+ homepage_uri: https://github.com/nolantait/rubocop-inhouse
123
+ source_code_uri: https://github.com/nolantait/rubocop-inhouse
124
+ changelog_uri: https://github.com/nolantait/rubocop-inhouse
125
+ rubygems_mfa_required: 'true'
126
+ post_install_message:
127
+ rdoc_options: []
128
+ require_paths:
129
+ - lib
130
+ required_ruby_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 3.2.0
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ requirements: []
141
+ rubygems_version: 3.4.21
142
+ signing_key:
143
+ specification_version: 4
144
+ summary: Rubocop configuration for InHouse projects
145
+ test_files: []