nxt_cop 1.3.1 → 2.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: f3ced16c64af5bb68e2c10850dd9277e29f3a39de3d9cc32bdde3296530f55cf
4
- data.tar.gz: 6fa32563d60a5fde5b6c4734617913d69cf6d6cd1441096fae6377837c75993a
3
+ metadata.gz: 530b577b485dd169ba5ef2bf3820e7a3fa6e8ec4a6604db775c755d5019a3dbc
4
+ data.tar.gz: cddfba144d854181aecd07f7e3ea98a24d83a281575ec7cece77543f7d9fd448
5
5
  SHA512:
6
- metadata.gz: 1d43e0c5e70c4b7241c58784717a3b5218e0267dcef358a00308f1689bc17d3f2067eeddc428769e41342c612ce144a137cd39ffc1f8b3ae68f92966c1d4fef2
7
- data.tar.gz: c8df079c6ffaac61b89fb07c04fdb38d466cb01ccd5be1c004cb9f73a104fa3647cd7b790dabeb02cdcf668fdf3718300f353a4fd747991e3fefe340d8ba0b22
6
+ metadata.gz: 04b24945b0ca039e944b465e822b9be9882672db7a2d9dca15528ae6be45945a0c2a3ec2ebd90a7ce7c48a6a10703ce183ffedb2c5b2e2f189ea79b7f3f07beb
7
+ data.tar.gz: 5c535e553548102f708b5c981e255af718bcdde9580cdda845a06ba7ae8f9cdd162139d2b0f7e4cc7873df53094677d0c21aac0f97848e5be69fc6b42cbc83d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v2.0.1 2024-01-10
2
+ ## What's Changed
3
+ * Disable more cops depending on the code style in our backend-services
4
+
5
+ * **Full Changelog**: https://github.com/nxt-insurance/nxt_cop/compare/v2.0.0...v2.0.1
6
+
7
+ # v2.0.0 2023-11-28
8
+ ## What's Changed
9
+ * Enabled all cops by default
10
+
11
+ **Full Changelog**: https://github.com/nxt-insurance/nxt_cop/compare/v1.3.1...v2.0.0
12
+
1
13
  # v1.3.1 2023-10-10
2
14
  ## What's Changed
3
15
  * Bumped dependencies version
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_cop (1.3.1)
5
- rubocop (~> 1.57.2)
4
+ nxt_cop (2.0.1)
5
+ rubocop (~> 1.60.0)
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.1.1)
12
+ activesupport (7.1.3)
13
13
  base64
14
14
  bigdecimal
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -21,49 +21,50 @@ GEM
21
21
  tzinfo (~> 2.0)
22
22
  ast (2.4.2)
23
23
  base64 (0.2.0)
24
- bigdecimal (3.1.4)
25
- concurrent-ruby (1.2.2)
24
+ bigdecimal (3.1.5)
25
+ concurrent-ruby (1.2.3)
26
26
  connection_pool (2.4.1)
27
27
  drb (2.2.0)
28
28
  ruby2_keywords
29
29
  i18n (1.14.1)
30
30
  concurrent-ruby (~> 1.0)
31
- json (2.6.3)
31
+ json (2.7.1)
32
32
  language_server-protocol (3.17.0.3)
33
- minitest (5.20.0)
33
+ minitest (5.21.1)
34
34
  mutex_m (0.2.0)
35
- parallel (1.23.0)
36
- parser (3.2.2.4)
35
+ parallel (1.24.0)
36
+ parser (3.3.0.4)
37
37
  ast (~> 2.4.1)
38
38
  racc
39
39
  racc (1.7.3)
40
40
  rack (3.0.8)
41
41
  rainbow (3.1.1)
42
42
  rake (13.1.0)
43
- regexp_parser (2.8.2)
43
+ regexp_parser (2.9.0)
44
44
  rexml (3.2.6)
45
- rubocop (1.57.2)
45
+ rubocop (1.60.0)
46
46
  json (~> 2.3)
47
47
  language_server-protocol (>= 3.17.0)
48
48
  parallel (~> 1.10)
49
- parser (>= 3.2.2.4)
49
+ parser (>= 3.3.0.2)
50
50
  rainbow (>= 2.2.2, < 4.0)
51
51
  regexp_parser (>= 1.8, < 3.0)
52
52
  rexml (>= 3.2.5, < 4.0)
53
- rubocop-ast (>= 1.28.1, < 2.0)
53
+ rubocop-ast (>= 1.30.0, < 2.0)
54
54
  ruby-progressbar (~> 1.7)
55
55
  unicode-display_width (>= 2.4.0, < 3.0)
56
56
  rubocop-ast (1.30.0)
57
57
  parser (>= 3.2.1.0)
58
- rubocop-capybara (2.19.0)
58
+ rubocop-capybara (2.20.0)
59
59
  rubocop (~> 1.41)
60
- rubocop-factory_bot (2.24.0)
61
- rubocop (~> 1.33)
62
- rubocop-rails (2.22.1)
60
+ rubocop-factory_bot (2.25.1)
61
+ rubocop (~> 1.41)
62
+ rubocop-rails (2.23.1)
63
63
  activesupport (>= 4.2.0)
64
64
  rack (>= 1.1)
65
65
  rubocop (>= 1.33.0, < 2.0)
66
- rubocop-rspec (2.25.0)
66
+ rubocop-ast (>= 1.30.0, < 2.0)
67
+ rubocop-rspec (2.26.1)
67
68
  rubocop (~> 1.40)
68
69
  rubocop-capybara (~> 2.17)
69
70
  rubocop-factory_bot (~> 2.22)
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,392 @@ 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
+ Style/MultilineTernaryOperator:
433
+ Enabled: false
434
+ Style/RedundantReturn:
435
+ Enabled: false
436
+ Style/ClassCheck:
437
+ Enabled: false
438
+ Style/LineEndConcatenation:
439
+ Enabled: false
440
+ Style/RedundantFetchBlock:
441
+ Enabled: false
442
+ Style/FloatDivision:
443
+ Enabled: false
444
+ Layout/MultilineOperationIndentation:
445
+ Enabled: false
446
+ Style/SoleNestedConditional:
447
+ Enabled: false
448
+ Rails/FindEach:
449
+ Enabled: false
450
+ Style/RedundantParentheses:
451
+ Enabled: false
452
+ Style/IfInsideElse:
453
+ Enabled: false
454
+ Style/EmptyCaseCondition:
455
+ Enabled: false
456
+ Style/TernaryParentheses:
457
+ EnforcedStyle: require_parentheses_when_complex
458
+ Style/HashLikeCase:
459
+ Enabled: false
460
+
461
+ # 🤔 Should we enable these cops or not? They look useful but require alignment within the team
462
+ Style/OpenStructUse:
463
+ Enabled: false
464
+ Style/RedundantConstantBase: # new in 1.40
465
+ Enabled: false
466
+ Naming/MemoizedInstanceVariableName:
467
+ Enabled: false
468
+ Style/ConditionalAssignment:
469
+ Enabled: false
470
+ Style/BlockDelimiters:
471
+ Enabled: false
472
+ Style/TrailingCommaInArrayLiteral:
473
+ Enabled: false
474
+ FactoryBot/FactoryClassName:
475
+ Enabled: false
476
+ Style/NumericLiteralPrefix:
477
+ Enabled: false
478
+ Style/OptionalBooleanParameter:
479
+ Enabled: false
480
+ Style/IdenticalConditionalBranches: # Is it safe to auto-fix?
481
+ Enabled: false
482
+ Naming/RescuedExceptionsVariableName: # Would be nice to have, but should align on the name first
483
+ Enabled: false
484
+
485
+ Naming/MethodParameterName: # should enable but we have to manually fix this
486
+ Enabled: false
487
+ Rails/UniqueValidationWithoutIndex: # definitely enable!!!
488
+ Enabled: false
489
+ Rails/Validation: # discuss with the team
490
+ Enabled: false
491
+ Rails/LexicallyScopedActionFilter: # enable and manually disable offences
492
+ Enabled: false
493
+ Security/Open:
494
+ Enabled: false
495
+ Naming/FileName:
496
+ Enabled: false
497
+ Style/EmptyElse:
498
+ Enabled: false
499
+ Style/MixinUsage: # Enable and then manually disable offenses?
500
+ Enabled: false
501
+
502
+
503
+
504
+ # ✅ Enabled in 2.0 version (activated by "enable all rules by default')
505
+ # Let's keep commented list here for visibility for a while
506
+ #
507
+ #Layout/SpaceInsideParens:
508
+ # Enabled: false
509
+ #Layout/SpaceBeforeFirstArg:
510
+ # Enabled: false
511
+ #Layout/ExtraSpacing:
512
+ # Enabled: false
513
+ #Layout/SpaceAfterColon:
514
+ # Enabled: false
515
+ #Rails/PluralizationGrammar:
516
+ # Enabled: false
517
+ #Layout/SpaceAroundMethodCallOperator:
518
+ # Enabled: false
519
+ #Style/RedundantFreeze:
520
+ # Enabled: false
521
+ #Layout/SpaceInLambdaLiteral:
522
+ # Enabled: false
523
+ #Layout/LeadingCommentSpace:
524
+ # Enabled: false
525
+ #Layout/DefEndAlignment:
526
+ # Enabled: false
527
+ #Style/RedundantRegexpEscape:
528
+ # Enabled: false
529
+ #Layout/HeredocIndentation:
530
+ # Enabled: false
531
+ #Layout/ClosingHeredocIndentation:
532
+ # Enabled: false
533
+ #Layout/LeadingEmptyLines:
534
+ # Enabled: false
535
+ #Layout/EmptyLinesAroundAccessModifier:
536
+ # Enabled: false
537
+ #Style/NegatedIf:
538
+ # Enabled: false
539
+ #Style/CommentAnnotation:
540
+ # Enabled: false
541
+ #Layout/MultilineOperationIndentation:
542
+ # Enabled: false
543
+ #Style/ExpandPathArguments:
544
+ # Enabled: false
545
+ #Layout/EmptyLinesAroundMethodBody:
546
+ # Enabled: false
547
+ #Style/RedundantReturn:
548
+ # Enabled: false
549
+ #Style/GlobalStdStream:
550
+ # Enabled: false
551
+ #Style/FloatDivision:
552
+ # Enabled: false
553
+ #Style/RescueStandardError:
554
+ # Enabled: false
555
+ #Style/NilComparison:
556
+ # Enabled: false
557
+ #Style/RedundantFetchBlock:
558
+ # Enabled: false
559
+ #Style/Encoding:
560
+ # Enabled: false
561
+ #Style/EmptyLiteral:
562
+ # Enabled: false
563
+ #Layout/SpaceInsideReferenceBrackets:
564
+ # Enabled: false
565
+ #Style/EmptyLambdaParameter:
566
+ # Enabled: false
567
+ #Style/TernaryParentheses:
568
+ # Enabled: false
569
+ #Naming/MethodName:
570
+ # Enabled: false
571
+ #Style/SlicingWithRange:
572
+ # Enabled: false
573
+ #Style/EmptyCaseCondition:
574
+ # Enabled: false
575
+ #Style/SoleNestedConditional:
576
+ # Enabled: false
577
+ #Rails/FindEach:
578
+ # Enabled: false
579
+ #Style/RedundantFileExtensionInRequire:
580
+ # Enabled: false
581
+ #Layout/SpaceInsideArrayLiteralBrackets:
582
+ # Enabled: false
583
+ #Style/HashAsLastArrayItem:
584
+ # Enabled: false
585
+ #Lint/RedundantCopDisableDirective:
586
+ # Enabled: false
587
+ #Layout/SpaceAroundKeyword:
588
+ # Enabled: false
589
+ #Style/KeywordParametersOrder:
590
+ # Enabled: false
591
+ #Style/BlockComments:
592
+ # Enabled: false
593
+ #Style/AndOr:
594
+ # Enabled: false
595
+ #Style/EachWithObject:
596
+ # Enabled: false
597
+ #Layout/SpaceAroundBlockParameters:
598
+ # Enabled: false
599
+ #Style/MultilineTernaryOperator:
600
+ # Enabled: false
601
+ #Style/RedundantParentheses:
602
+ # Enabled: false
603
+ #Security/JSONLoad:
604
+ # Enabled: false
605
+ #Style/MethodCallWithoutArgsParentheses:
606
+ # Enabled: false
607
+ #Style/CommentedKeyword:
608
+ # Enabled: false
609
+ #Style/MultilineIfModifier:
610
+ # Enabled: false
611
+ #Style/IfInsideElse:
612
+ # Enabled: false
613
+ #Style/AccessorGrouping:
614
+ # Enabled: false
615
+ #Layout/BlockEndNewline:
616
+ # Enabled: false
617
+ #Rails/RedundantForeignKey:
618
+ # Enabled: false
619
+ #Style/UnlessElse:
620
+ # Enabled: false
621
+ #Layout/EmptyLinesAroundModuleBody:
622
+ # Enabled: false
623
+ #Rails/RakeEnvironment:
624
+ # Enabled: false
625
+ #Layout/EmptyLinesAroundArguments:
626
+ # Enabled: false
627
+ #Style/EachForSimpleLoop:
628
+ # Enabled: false
629
+ #Style/ClassCheck:
630
+ # Enabled: false
631
+ #Style/NestedParenthesizedCalls:
632
+ # Enabled: false
633
+ #Style/LineEndConcatenation:
634
+ # Enabled: false
635
+ #Style/ParallelAssignment:
636
+ # Enabled: false
637
+ #Layout/EmptyLinesAroundExceptionHandlingKeywords:
638
+ # Enabled: false
639
+ #Layout/SpaceAroundEqualsInParameterDefault:
640
+ # Enabled: false
641
+ #Style/YodaCondition:
642
+ # Enabled: false
643
+ #Layout/SpaceInsideStringInterpolation:
644
+ # Enabled: false
645
+ #Style/EmptyMethod:
646
+ # Enabled: false
647
+ #Layout/EmptyLineBetweenDefs:
648
+ # Enabled: false
649
+ #Naming/ConstantName:
650
+ # Enabled: false
651
+ #Rails/RelativeDateConstant:
652
+ # Enabled: false
@@ -1,3 +1,3 @@
1
1
  module NxtCop
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '2.0.1'.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.57.2'
34
+ spec.required_ruby_version = '>= 3.2'
35
+
36
+ spec.add_dependency 'rubocop', '~> 1.60.0'
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.1
4
+ version: 2.0.1
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-11-10 00:00:00.000000000 Z
11
+ date: 2024-01-17 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.57.2
19
+ version: 1.60.0
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.57.2
26
+ version: 1.60.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ 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
  - - ">="