nxt_cop 1.3.0 → 2.0.0

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: c9cbb2bc281782ecc8344596723250c60a347e54756fb8ab3e901903fce85437
4
- data.tar.gz: 1ed23e495e6d4eb4287e58115c442c62a497d8b300db00e41b8d2b5633e7e9cb
3
+ metadata.gz: 1eb597d25eddcad36a8b678d16aec8012a29e0b9c33a145fc7e528303cf1ea27
4
+ data.tar.gz: dfa1494d7e788cf1500f030938995d8e5a53a74cee29d3b1fc726687dc7cab85
5
5
  SHA512:
6
- metadata.gz: 36b72e877b2d70bc2a51075442e269801cc059e19113948b592e7d6a94c95df5306963175bb06257e7b79843bc15367b53b2d001204178587a93adce73b953d6
7
- data.tar.gz: aceeda13120fa2354923c432daa796c4eb4ed9675a270a150d984d76408a41c8aa6bce21e23ef881032643a13c4816a65377aa0e8caa543e14a0bb54c571c999
6
+ metadata.gz: 1d2923f5964870f8e7262c19476874f01e1785ddbba09ce158909f3cbf0758f7857de4df85586372abb669686d79cbf74f49d74500a4566e457b4eecca830583
7
+ data.tar.gz: 5e7efb90fc058ffc9b7c02a6aa948fcd0b20cf50c3b274998dbcc0ca5acc7c268c950afa97031073202747b009c4e520a1b400a1f60d2110f9479c340298acba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v2.0.0 2023-11-28
2
+ ## What's Changed
3
+ * Enabled all cops by default
4
+
5
+ **Full Changelog**: https://github.com/nxt-insurance/nxt_cop/compare/v1.3.1...v2.0.0
6
+
7
+ # v1.3.1 2023-10-10
8
+ ## What's Changed
9
+ * Bumped dependencies version
10
+
11
+ **Full Changelog**: https://github.com/nxt-insurance/nxt_cop/compare/v1.3.0...v1.3.1
12
+
1
13
  # v1.3.0 2023-09-22
2
14
  ## What's Changed
3
15
  * `inherit_mode` was added to `default.yml`
data/Gemfile.lock CHANGED
@@ -1,64 +1,78 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_cop (1.3.0)
5
- rubocop (~> 1.56.1)
4
+ nxt_cop (2.0.0)
5
+ rubocop (~> 1.57.2)
6
6
  rubocop-rails (~> 2.8)
7
7
  rubocop-rspec (~> 2.12)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.0.7.2)
12
+ activesupport (7.1.2)
13
+ base64
14
+ bigdecimal
13
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ connection_pool (>= 2.2.5)
17
+ drb
14
18
  i18n (>= 1.6, < 2)
15
19
  minitest (>= 5.1)
20
+ mutex_m
16
21
  tzinfo (~> 2.0)
17
22
  ast (2.4.2)
18
- base64 (0.1.1)
23
+ base64 (0.2.0)
24
+ bigdecimal (3.1.4)
19
25
  concurrent-ruby (1.2.2)
26
+ connection_pool (2.4.1)
27
+ drb (2.2.0)
28
+ ruby2_keywords
20
29
  i18n (1.14.1)
21
30
  concurrent-ruby (~> 1.0)
22
31
  json (2.6.3)
23
32
  language_server-protocol (3.17.0.3)
24
33
  minitest (5.20.0)
34
+ mutex_m (0.2.0)
25
35
  parallel (1.23.0)
26
- parser (3.2.2.3)
36
+ parser (3.2.2.4)
27
37
  ast (~> 2.4.1)
28
38
  racc
29
- racc (1.7.1)
39
+ racc (1.7.3)
30
40
  rack (3.0.8)
31
41
  rainbow (3.1.1)
32
- rake (13.0.6)
33
- regexp_parser (2.8.1)
42
+ rake (13.1.0)
43
+ regexp_parser (2.8.2)
34
44
  rexml (3.2.6)
35
- rubocop (1.56.3)
36
- base64 (~> 0.1.1)
45
+ rubocop (1.57.2)
37
46
  json (~> 2.3)
38
47
  language_server-protocol (>= 3.17.0)
39
48
  parallel (~> 1.10)
40
- parser (>= 3.2.2.3)
49
+ parser (>= 3.2.2.4)
41
50
  rainbow (>= 2.2.2, < 4.0)
42
51
  regexp_parser (>= 1.8, < 3.0)
43
52
  rexml (>= 3.2.5, < 4.0)
44
53
  rubocop-ast (>= 1.28.1, < 2.0)
45
54
  ruby-progressbar (~> 1.7)
46
55
  unicode-display_width (>= 2.4.0, < 3.0)
47
- rubocop-ast (1.29.0)
56
+ rubocop-ast (1.30.0)
48
57
  parser (>= 3.2.1.0)
49
- rubocop-capybara (2.17.1)
58
+ rubocop-capybara (2.19.0)
50
59
  rubocop (~> 1.41)
51
- rubocop-rails (2.18.0)
60
+ rubocop-factory_bot (2.24.0)
61
+ rubocop (~> 1.33)
62
+ rubocop-rails (2.22.2)
52
63
  activesupport (>= 4.2.0)
53
64
  rack (>= 1.1)
54
65
  rubocop (>= 1.33.0, < 2.0)
55
- rubocop-rspec (2.19.0)
56
- rubocop (~> 1.33)
66
+ rubocop-ast (>= 1.30.0, < 2.0)
67
+ rubocop-rspec (2.25.0)
68
+ rubocop (~> 1.40)
57
69
  rubocop-capybara (~> 2.17)
70
+ rubocop-factory_bot (~> 2.22)
58
71
  ruby-progressbar (1.13.0)
72
+ ruby2_keywords (0.0.5)
59
73
  tzinfo (2.0.6)
60
74
  concurrent-ruby (~> 1.0)
61
- unicode-display_width (2.4.2)
75
+ unicode-display_width (2.5.0)
62
76
 
63
77
  PLATFORMS
64
78
  ruby
data/README.md CHANGED
@@ -81,6 +81,7 @@ Add to `~/.gem/credentials` (create if it doesn't exist):
81
81
  - Run `rubocop` to see if new rules were added
82
82
  - If yes, add them to `default.yml` to prevent "New rules" warning
83
83
  - Update the version number in `version.rb`
84
+ - Run `bundle install` again to update the version in Gemfile.lock
84
85
  - Update the `CHANGELOG.md`
85
86
  - Open the PR, merge everything to `main`
86
87
 
data/default.yml CHANGED
@@ -18,7 +18,8 @@ AllCops:
18
18
  - db/migrate/*
19
19
  - vendor/**/*
20
20
  - node_modules/**/*
21
- DisabledByDefault: true
21
+ DisabledByDefault: false
22
+ NewCops: disable # to avoid warnings. TODO: remove this setting and add new cops from the warning.
22
23
 
23
24
  # A bunch of these layout cops are enabled by default,
24
25
  # but for some reason 'DisableByDefault' is set to 'true' above.
@@ -260,3 +261,364 @@ Lint/MixedCaseRange:
260
261
  Enabled: true
261
262
  Lint/RedundantRegexpQuantifiers:
262
263
  Enabled: true
264
+
265
+ # This is default cops we want to keep disabled:
266
+ Style/FrozenStringLiteralComment:
267
+ Enabled: false
268
+ Layout/LineLength:
269
+ Enabled: false
270
+ Style/ArgumentsForwarding:
271
+ Enabled: false
272
+ Naming/BlockForwarding:
273
+ Enabled: false
274
+ Rails/FreezeTime:
275
+ Enabled: false
276
+ Style/Documentation:
277
+ Enabled: false
278
+ Metrics/MethodLength:
279
+ Enabled: false
280
+ Naming/VariableNumber:
281
+ Enabled: false
282
+ Metrics/AbcSize:
283
+ Enabled: false
284
+ Metrics/ClassLength:
285
+ Enabled: false
286
+ Style/ClassAndModuleChildren:
287
+ Enabled: false
288
+ Metrics/BlockLength:
289
+ Enabled: false
290
+ Metrics/CyclomaticComplexity:
291
+ Enabled: false
292
+ Style/SafeNavigation:
293
+ Enabled: false
294
+ Rails/Output:
295
+ Enabled: false
296
+ Style/Next: # this one looks dangerous
297
+ Enabled: false
298
+ Bundler/OrderedGems:
299
+ Enabled: false
300
+ Bundler/DuplicatedGroup:
301
+ Enabled: false
302
+ Rails/HttpStatus:
303
+ Enabled: false
304
+ Rails/SkipsModelValidations:
305
+ Enabled: false
306
+ Style/InfiniteLoop:
307
+ Enabled: false
308
+ Style/StderrPuts:
309
+ Enabled: false
310
+ Style/NumericPredicate:
311
+ Enabled: false
312
+ Metrics/PerceivedComplexity:
313
+ Enabled: false
314
+ Style/RegexpLiteral:
315
+ Enabled: false
316
+ Rails/Delegate:
317
+ Enabled: false
318
+ Style/RaiseArgs:
319
+ Enabled: false
320
+ Rails/HasManyOrHasOneDependent: # Nice to have but challenging to fix
321
+ Enabled: false
322
+ Rails/InverseOf:
323
+ Enabled: false
324
+ Style/MultilineBlockChain:
325
+ Enabled: false
326
+ Naming/AccessorMethodName:
327
+ Enabled: false
328
+ Naming/PredicateName:
329
+ Enabled: false
330
+ Style/FormatStringToken:
331
+ Enabled: false
332
+ Style/RedundantSort: # dangerous since autofix breaks the code
333
+ Enabled: false
334
+ Style/SymbolProc:
335
+ Enabled: false
336
+ Rails/ApplicationController:
337
+ Enabled: false
338
+ Rails/ApplicationRecord:
339
+ Enabled: false
340
+ Style/ExplicitBlockArgument:
341
+ Enabled: false
342
+ Rails/DynamicFindBy:
343
+ Enabled: false
344
+ Metrics/ParameterLists:
345
+ Enabled: false
346
+ Rails/IndexWith:
347
+ Enabled: false
348
+ Style/FormatString:
349
+ Enabled: false
350
+ Rails/Blank:
351
+ Enabled: false
352
+ Rails/Present:
353
+ Enabled: false
354
+ Style/NumericLiterals:
355
+ Enabled: false
356
+ Style/Lambda:
357
+ Enabled: false
358
+ Style/Proc:
359
+ Enabled: false
360
+ Style/ExponentialNotation:
361
+ Enabled: false
362
+ Style/PreferredHashMethods: # can be changed via vote
363
+ Enabled: false
364
+ Rails/Presence:
365
+ Enabled: false
366
+ Metrics/ModuleLength:
367
+ Enabled: false
368
+ Style/RedundantConditional:
369
+ Enabled: false
370
+ Style/TrailingUnderscoreVariable:
371
+ Enabled: false
372
+ Style/ParenthesesAroundCondition:
373
+ Enabled: false
374
+ Style/HashEachMethods:
375
+ Enabled: false
376
+ Style/RedundantAssignment:
377
+ Enabled: false
378
+ Style/CaseLikeIf:
379
+ Enabled: false
380
+ Style/RedundantBegin:
381
+ Enabled: false
382
+ Rails/FilePath:
383
+ Enabled: false
384
+ Style/Alias:
385
+ Enabled: false
386
+ Style/SingleArgumentDig:
387
+ Enabled: false
388
+ Style/RescueModifier: # because it's heavily used in application service
389
+ Enabled: false
390
+ Style/IfUnlessModifier:
391
+ Enabled: false
392
+ Naming/BinaryOperatorParameterName:
393
+ Enabled: false
394
+ Style/SignalException:
395
+ Enabled: false
396
+ Style/TrivialAccessors:
397
+ Enabled: false
398
+ Rails/HasAndBelongsToMany:
399
+ Enabled: false
400
+ Style/AccessModifierDeclarations:
401
+ Enabled: false
402
+ Rails/ReadWriteAttribute:
403
+ Enabled: false
404
+ Rails/RedundantReceiverInWithOptions:
405
+ Enabled: false
406
+ Style/HashTransformValues:
407
+ Enabled: false
408
+ Rails/IndexBy:
409
+ Enabled: false
410
+ Rails/Pick:
411
+ Enabled: false
412
+ Style/CombinableLoops: # hard to autocorrect properly
413
+ Enabled: false
414
+ FactoryBot/CreateList:
415
+ Enabled: false
416
+ Rails/ReflectionClassName:
417
+ Enabled: false
418
+ Style/RedundantSelf:
419
+ Enabled: false
420
+ Style/GuardClause:
421
+ Enabled: false
422
+ Style/PercentLiteralDelimiters:
423
+ Enabled: false
424
+ Style/StringConcatenation: # heavily used in insurance service
425
+ Enabled: false
426
+ Style/InverseMethods:
427
+ Enabled: false
428
+ Style/RedundantInterpolation:
429
+ Enabled: false
430
+ Style/ZeroLengthPredicate:
431
+ Enabled: false
432
+
433
+ # 🤔 Should we enable these cops or not? They look useful but require alignment within the team
434
+ Style/OpenStructUse:
435
+ Enabled: false
436
+ Style/RedundantConstantBase: # new in 1.40
437
+ Enabled: false
438
+ Naming/MemoizedInstanceVariableName:
439
+ Enabled: false
440
+ Style/ConditionalAssignment:
441
+ Enabled: false
442
+ Style/BlockDelimiters:
443
+ Enabled: false
444
+ Style/TrailingCommaInArrayLiteral:
445
+ Enabled: false
446
+ FactoryBot/FactoryClassName:
447
+ Enabled: false
448
+ Style/NumericLiteralPrefix:
449
+ Enabled: false
450
+ Style/OptionalBooleanParameter:
451
+ Enabled: false
452
+ Style/IdenticalConditionalBranches: # Is it safe to auto-fix?
453
+ Enabled: false
454
+ Naming/RescuedExceptionsVariableName: # Would be nice to have, but should align on the name first
455
+ Enabled: false
456
+
457
+ Naming/MethodParameterName: # should enable but we have to manually fix this
458
+ Enabled: false
459
+ Rails/UniqueValidationWithoutIndex: # definitely enable!!!
460
+ Enabled: false
461
+ Rails/Validation: # discuss with the team
462
+ Enabled: false
463
+ Rails/LexicallyScopedActionFilter: # enable and manually disable offences
464
+ Enabled: false
465
+ Security/Open:
466
+ Enabled: false
467
+ Naming/FileName:
468
+ Enabled: false
469
+ Style/EmptyElse:
470
+ Enabled: false
471
+ Style/MixinUsage: # Enable and then manually disable offenses?
472
+ Enabled: false
473
+
474
+
475
+
476
+ # ✅ Enabled in 2.0 version (activated by "enable all rules by default')
477
+ # Let's keep commented list here for visibility for a while
478
+ #
479
+ #Layout/SpaceInsideParens:
480
+ # Enabled: false
481
+ #Layout/SpaceBeforeFirstArg:
482
+ # Enabled: false
483
+ #Layout/ExtraSpacing:
484
+ # Enabled: false
485
+ #Layout/SpaceAfterColon:
486
+ # Enabled: false
487
+ #Rails/PluralizationGrammar:
488
+ # Enabled: false
489
+ #Layout/SpaceAroundMethodCallOperator:
490
+ # Enabled: false
491
+ #Style/RedundantFreeze:
492
+ # Enabled: false
493
+ #Layout/SpaceInLambdaLiteral:
494
+ # Enabled: false
495
+ #Layout/LeadingCommentSpace:
496
+ # Enabled: false
497
+ #Layout/DefEndAlignment:
498
+ # Enabled: false
499
+ #Style/RedundantRegexpEscape:
500
+ # Enabled: false
501
+ #Layout/HeredocIndentation:
502
+ # Enabled: false
503
+ #Layout/ClosingHeredocIndentation:
504
+ # Enabled: false
505
+ #Layout/LeadingEmptyLines:
506
+ # Enabled: false
507
+ #Layout/EmptyLinesAroundAccessModifier:
508
+ # Enabled: false
509
+ #Style/NegatedIf:
510
+ # Enabled: false
511
+ #Style/CommentAnnotation:
512
+ # Enabled: false
513
+ #Layout/MultilineOperationIndentation:
514
+ # Enabled: false
515
+ #Style/ExpandPathArguments:
516
+ # Enabled: false
517
+ #Layout/EmptyLinesAroundMethodBody:
518
+ # Enabled: false
519
+ #Style/RedundantReturn:
520
+ # Enabled: false
521
+ #Style/GlobalStdStream:
522
+ # Enabled: false
523
+ #Style/FloatDivision:
524
+ # Enabled: false
525
+ #Style/RescueStandardError:
526
+ # Enabled: false
527
+ #Style/NilComparison:
528
+ # Enabled: false
529
+ #Style/RedundantFetchBlock:
530
+ # Enabled: false
531
+ #Style/Encoding:
532
+ # Enabled: false
533
+ #Style/EmptyLiteral:
534
+ # Enabled: false
535
+ #Layout/SpaceInsideReferenceBrackets:
536
+ # Enabled: false
537
+ #Style/EmptyLambdaParameter:
538
+ # Enabled: false
539
+ #Style/TernaryParentheses:
540
+ # Enabled: false
541
+ #Naming/MethodName:
542
+ # Enabled: false
543
+ #Style/SlicingWithRange:
544
+ # Enabled: false
545
+ #Style/EmptyCaseCondition:
546
+ # Enabled: false
547
+ #Style/SoleNestedConditional:
548
+ # Enabled: false
549
+ #Rails/FindEach:
550
+ # Enabled: false
551
+ #Style/RedundantFileExtensionInRequire:
552
+ # Enabled: false
553
+ #Layout/SpaceInsideArrayLiteralBrackets:
554
+ # Enabled: false
555
+ #Style/HashAsLastArrayItem:
556
+ # Enabled: false
557
+ #Lint/RedundantCopDisableDirective:
558
+ # Enabled: false
559
+ #Layout/SpaceAroundKeyword:
560
+ # Enabled: false
561
+ #Style/KeywordParametersOrder:
562
+ # Enabled: false
563
+ #Style/BlockComments:
564
+ # Enabled: false
565
+ #Style/AndOr:
566
+ # Enabled: false
567
+ #Style/EachWithObject:
568
+ # Enabled: false
569
+ #Layout/SpaceAroundBlockParameters:
570
+ # Enabled: false
571
+ #Style/MultilineTernaryOperator:
572
+ # Enabled: false
573
+ #Style/RedundantParentheses:
574
+ # Enabled: false
575
+ #Security/JSONLoad:
576
+ # Enabled: false
577
+ #Style/MethodCallWithoutArgsParentheses:
578
+ # Enabled: false
579
+ #Style/CommentedKeyword:
580
+ # Enabled: false
581
+ #Style/MultilineIfModifier:
582
+ # Enabled: false
583
+ #Style/IfInsideElse:
584
+ # Enabled: false
585
+ #Style/AccessorGrouping:
586
+ # Enabled: false
587
+ #Layout/BlockEndNewline:
588
+ # Enabled: false
589
+ #Rails/RedundantForeignKey:
590
+ # Enabled: false
591
+ #Style/UnlessElse:
592
+ # Enabled: false
593
+ #Layout/EmptyLinesAroundModuleBody:
594
+ # Enabled: false
595
+ #Rails/RakeEnvironment:
596
+ # Enabled: false
597
+ #Layout/EmptyLinesAroundArguments:
598
+ # Enabled: false
599
+ #Style/EachForSimpleLoop:
600
+ # Enabled: false
601
+ #Style/ClassCheck:
602
+ # Enabled: false
603
+ #Style/NestedParenthesizedCalls:
604
+ # Enabled: false
605
+ #Style/LineEndConcatenation:
606
+ # Enabled: false
607
+ #Style/ParallelAssignment:
608
+ # Enabled: false
609
+ #Layout/EmptyLinesAroundExceptionHandlingKeywords:
610
+ # Enabled: false
611
+ #Layout/SpaceAroundEqualsInParameterDefault:
612
+ # Enabled: false
613
+ #Style/YodaCondition:
614
+ # Enabled: false
615
+ #Layout/SpaceInsideStringInterpolation:
616
+ # Enabled: false
617
+ #Style/EmptyMethod:
618
+ # Enabled: false
619
+ #Layout/EmptyLineBetweenDefs:
620
+ # Enabled: false
621
+ #Naming/ConstantName:
622
+ # Enabled: false
623
+ #Rails/RelativeDateConstant:
624
+ # Enabled: false
@@ -1,3 +1,3 @@
1
1
  module NxtCop
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
data/nxt_cop.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'nxt_cop/version'
4
4
 
@@ -24,14 +24,16 @@ Gem::Specification.new do |spec|
24
24
  'public gem pushes.'
25
25
  end
26
26
 
27
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
28
  f.match(%r{^(test|spec|features)/})
29
29
  end
30
30
  spec.bindir = 'exe'
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_dependency 'rubocop', '~> 1.56.1'
34
+ spec.required_ruby_version = '>= 3.2'
35
+
36
+ spec.add_dependency 'rubocop', '~> 1.57.2'
35
37
  spec.add_dependency 'rubocop-rails', '~> 2.8'
36
38
  spec.add_dependency 'rubocop-rspec', '~> 2.12'
37
39
  spec.add_development_dependency 'bundler', '~> 2.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Livingstone
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.56.1
19
+ version: 1.57.2
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: 1.56.1
26
+ version: 1.57.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -117,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: '0'
120
+ version: '3.2'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.4.6
127
+ rubygems_version: 3.4.10
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Getsafe shared Rubocop.