rubocop-intum 0.1.4 → 0.1.5

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: 91663a3b40a2838cc3a322c54c3fda8d8c1aca73a634e38a96665c3aa38786ee
4
- data.tar.gz: 606e19e9eebea1d97a0e29d956fcd9b0ed18f230a3624eecc8ad37f21d1b1a78
3
+ metadata.gz: ec034bca9d1a04edb711e9122f2f831f7457b3018160eee272d978b16bc1372d
4
+ data.tar.gz: 8e811d95a43b87696f4e47213670509324e79f052cac18955f87b7b182f4448d
5
5
  SHA512:
6
- metadata.gz: 5a86e39529cc2c51e9ed1ea161987e529685e8cbfce793b82f3e9d26b2e3219502a2910e40387a9f1a70ff090ab28fae53a3c6571f2346be7e5a8945e99fc2c6
7
- data.tar.gz: 169baffde8d49aa0e6f62a0cd150fc530d696f8e0d1909afe806e05a27149bd21451b2cd98eeb03b70db15a9b8589535ff97a35b515757ff0912f4619854dd39
6
+ metadata.gz: 883138750e81dc556b3918daa9de3572841a8ba34e23e5ea6bd9e2e7ed6c0913f9d1468d0bfdba8465341cbd5aca790b1fe30c4bd96ff8dbe864d2f6d41f3326
7
+ data.tar.gz: c85b8294ded5ca2c851d90958bec706d6bd00b21fffb2ed46085e8c6621d5e10310f8dec5049b9724f89304ec9397fa4e295c297b2f1305b2ca368ee6509b9d6
data/.rubocop.yml CHANGED
@@ -111,3 +111,17 @@ Metrics/PerceivedComplexity:
111
111
  IgnoredMethods: []
112
112
  Max: 20
113
113
 
114
+ Metrics/AbcSize:
115
+ Description: >-
116
+ A calculated magnitude based on number of assignments,
117
+ branches, and conditions.
118
+ Reference:
119
+ - http://c2.com/cgi/wiki?AbcMetric
120
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
121
+ Enabled: true
122
+ VersionAdded: '0.27'
123
+ VersionChanged: '0.81'
124
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
125
+ # a Float.
126
+ AllowedMethods: []
127
+ Max: 50
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module Intum
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
data/rubocop.yml CHANGED
@@ -1,9 +1,13 @@
1
+ # v0.1.5
2
+ # https://github.com/intum/rubocop-intum/blob/main/rubocop.yml
3
+
1
4
  # tu wpisujemy tylko różnice w odniesieniu od domyślnych reguł z pliku:
2
5
  # https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
3
- # https://github.com/Shopify/ruby-style-guide/blob/v2.8.0/rubocop.yml
6
+ # https://github.com/Shopify/ruby-style-guide/blob/main/rubocop.yml
4
7
 
5
8
  inherit_gem:
6
9
  rubocop-shopify: rubocop.yml
10
+ # inherit_from: rubocop-shopify.yml
7
11
 
8
12
  require:
9
13
  - rubocop-minitest
@@ -65,21 +69,21 @@ Layout/FirstHashElementIndentation:
65
69
  # But it can be overridden by setting this parameter
66
70
  IndentationWidth: ~
67
71
 
68
- Layout/SpaceBeforeBlockBraces:
69
- Description: >-
70
- Checks that the left block brace has or doesn't have space
71
- before it.
72
- Enabled: false
73
- VersionAdded: '0.49'
74
- EnforcedStyle: space
75
- SupportedStyles:
76
- - space
77
- - no_space
78
- EnforcedStyleForEmptyBraces: space
79
- SupportedStylesForEmptyBraces:
80
- - space
81
- - no_space
82
- VersionChanged: '0.52.1'
72
+ # Layout/SpaceBeforeBlockBraces:
73
+ # Description: >-
74
+ # Checks that the left block brace has or doesn't have space
75
+ # before it.
76
+ # Enabled: false
77
+ # VersionAdded: '0.49'
78
+ # EnforcedStyle: no_space
79
+ # SupportedStyles:
80
+ # - space
81
+ # - no_space
82
+ # EnforcedStyleForEmptyBraces: space
83
+ # SupportedStylesForEmptyBraces:
84
+ # - space
85
+ # - no_space
86
+ # VersionChanged: '0.52.1'
83
87
 
84
88
  Layout/SpaceInsideHashLiteralBraces:
85
89
  Description: "Use spaces inside hash literal braces - or don't."
@@ -107,28 +111,17 @@ Layout/TrailingWhitespace:
107
111
  VersionChanged: '0.83'
108
112
  AllowInHeredoc: true # TO CHECK
109
113
 
110
- Metrics/AbcSize:
111
- Description: >-
112
- A calculated magnitude based on number of assignments,
113
- branches, and conditions.
114
- Reference:
115
- - http://c2.com/cgi/wiki?AbcMetric
116
- - https://en.wikipedia.org/wiki/ABC_Software_Metric
117
- Enabled: true
118
- VersionAdded: '0.27'
119
- VersionChanged: '0.81'
120
- # The ABC size is a calculated magnitude, so this number can be an Integer or
121
- # a Float.
122
- AllowedMethods: []
123
- Max: 50
124
-
114
+ Layout/ParameterAlignment:
115
+ EnforcedStyle: with_fixed_indentation
125
116
 
117
+ # wyjaśnienie: nie wiem dlaczego get w prefixie metody jest zle
126
118
  Naming/AccessorMethodName:
127
119
  Description: Check the naming of accessor methods for get_/set_.
128
120
  StyleGuide: '#accessor_mutator_method_names'
129
121
  Enabled: false
130
122
  VersionAdded: '0.50'
131
123
 
124
+ # wyjaśnienie: można to włączyć
132
125
  Naming/PredicateName:
133
126
  Description: 'Check the names of predicate methods.'
134
127
  StyleGuide: '#bool-methods-qmark'
@@ -158,6 +151,12 @@ Naming/PredicateName:
158
151
  Exclude:
159
152
  - 'spec/**/*'
160
153
 
154
+ # wyjaśnienie: railsy nie spełniają
155
+ Naming/InclusiveLanguage:
156
+ Enabled: false
157
+
158
+ # Naming/BlockForwarding:
159
+ # Enabled: false
161
160
 
162
161
  Style/AndOr:
163
162
  Description: 'Use &&/|| instead of and/or.'
@@ -172,14 +171,13 @@ Style/AndOr:
172
171
  - always
173
172
  - conditionals
174
173
 
175
-
176
- Style/AsciiComments:
177
- Description: 'Use only ascii symbols in comments.'
178
- StyleGuide: '#english-comments'
179
- Enabled: false
180
- VersionAdded: '0.9'
181
- VersionChanged: '0.52'
182
- AllowedChars: []
174
+ # Style/AsciiComments:
175
+ # Description: 'Use only ascii symbols in comments.'
176
+ # StyleGuide: '#english-comments'
177
+ # Enabled: false
178
+ # VersionAdded: '0.9'
179
+ # VersionChanged: '0.52'
180
+ # AllowedChars: []
183
181
 
184
182
  Style/BlockDelimiters:
185
183
  Description: >-
@@ -302,7 +300,7 @@ Style/ClassAndModuleChildren:
302
300
  # have the knowledge to perform either operation safely and thus requires
303
301
  # manual oversight.
304
302
  SafeAutoCorrect: false
305
- Enabled: false
303
+ Enabled: true
306
304
  VersionAdded: '0.19'
307
305
  #
308
306
  # Basically there are two different styles:
@@ -318,25 +316,25 @@ Style/ClassAndModuleChildren:
318
316
  # end
319
317
  #
320
318
  # The compact style is only forced, for classes or modules with one child.
321
- EnforcedStyle: nested
319
+ EnforcedStyle: compact
322
320
  SupportedStyles:
323
321
  - nested
324
322
  - compact
325
323
 
326
- Style/CommentedKeyword:
327
- Description: 'Do not place comments on the same line as certain keywords.'
328
- Enabled: false
329
- VersionAdded: '0.51'
324
+ # Style/CommentedKeyword:
325
+ # Description: 'Do not place comments on the same line as certain keywords.'
326
+ # Enabled: false
327
+ # VersionAdded: '0.51'
330
328
 
331
329
  Style/ConditionalAssignment:
332
330
  Description: >-
333
331
  Use the return value of `if` and `case` statements for
334
332
  assignment to a variable and variable comparison instead
335
333
  of assigning that variable inside of each branch.
336
- Enabled: false
334
+ Enabled: true
337
335
  VersionAdded: '0.36'
338
336
  VersionChanged: '0.47'
339
- EnforcedStyle: assign_to_condition
337
+ EnforcedStyle: assign_inside_condition
340
338
  SupportedStyles:
341
339
  - assign_to_condition
342
340
  - assign_inside_condition
@@ -347,16 +345,15 @@ Style/ConditionalAssignment:
347
345
  # will only register an offense for assignment to a condition that has
348
346
  # at least one multiline branch.
349
347
  SingleLineConditionsOnly: true
350
- IncludeTernaryExpressions: true
351
-
352
- Style/Documentation:
353
- Description: 'Document classes and non-namespace modules.'
354
- Enabled: false
355
- VersionAdded: '0.9'
356
- Exclude:
357
- - 'spec/**/*'
358
- - 'test/**/*'
348
+ IncludeTernaryExpressions: false
359
349
 
350
+ # Style/Documentation:
351
+ # Description: 'Document classes and non-namespace modules.'
352
+ # Enabled: false
353
+ # VersionAdded: '0.9'
354
+ # Exclude:
355
+ # - 'spec/**/*'
356
+ # - 'test/**/*'
360
357
 
361
358
  Style/EmptyMethod:
362
359
  Description: 'Checks the formatting of empty method definitions.'
@@ -405,10 +402,10 @@ Style/FrozenStringLiteralComment:
405
402
  Description: >-
406
403
  Add the frozen_string_literal comment to the top of files
407
404
  to help transition to frozen string literals by default.
408
- Enabled: false
405
+ Enabled: true
409
406
  VersionAdded: '0.36'
410
407
  VersionChanged: '0.79'
411
- EnforcedStyle: always
408
+ EnforcedStyle: never
412
409
  SupportedStyles:
413
410
  # `always` will always add the frozen string literal comment to a file
414
411
  # regardless of the Ruby version or if `freeze` or `<<` are called on a
@@ -424,37 +421,38 @@ Style/FrozenStringLiteralComment:
424
421
  SafeAutoCorrect: false
425
422
 
426
423
 
427
- Style/IfUnlessModifier:
428
- Description: >-
429
- Favor modifier if/unless usage when you have a
430
- single-line body.
431
- StyleGuide: '#if-as-a-modifier'
432
- Enabled: false
433
- VersionAdded: '0.9'
434
- VersionChanged: '0.30'
424
+ # Style/IfUnlessModifier:
425
+ # Description: >-
426
+ # Favor modifier if/unless usage when you have a
427
+ # single-line body.
428
+ # StyleGuide: '#if-as-a-modifier'
429
+ # Enabled: false
430
+ # VersionAdded: '0.9'
431
+ # VersionChanged: '0.30'
435
432
 
436
433
  Style/MultilineMethodSignature:
437
434
  Description: 'Avoid multi-line method signatures.'
438
435
  Enabled: true
439
436
  VersionAdded: '0.59'
440
437
 
441
- Style/MutableConstant:
442
- Description: 'Do not assign mutable objects to constants.'
443
- Enabled: false
444
- VersionAdded: '0.34'
445
- VersionChanged: '0.65'
446
- EnforcedStyle: literals
447
- SupportedStyles:
448
- # literals: freeze literals assigned to constants
449
- # strict: freeze all constants
450
- # Strict mode is considered an experimental feature. It has not been updated
451
- # with an exhaustive list of all methods that will produce frozen objects so
452
- # there is a decent chance of getting some false positives. Luckily, there is
453
- # no harm in freezing an already frozen object.
454
- - literals
455
- - strict
438
+ # Style/MutableConstant:
439
+ # Description: 'Do not assign mutable objects to constants.'
440
+ # Enabled: false
441
+ # VersionAdded: '0.34'
442
+ # VersionChanged: '0.65'
443
+ # EnforcedStyle: literals
444
+ # SupportedStyles:
445
+ # # literals: freeze literals assigned to constants
446
+ # # strict: freeze all constants
447
+ # # Strict mode is considered an experimental feature. It has not been updated
448
+ # # with an exhaustive list of all methods that will produce frozen objects so
449
+ # # there is a decent chance of getting some false positives. Luckily, there is
450
+ # # no harm in freezing an already frozen object.
451
+ # - literals
452
+ # - strict
456
453
 
457
454
 
455
+ # wyjaśnienie: generalnie jestem przeciwnikiem `unless`
458
456
  Style/NegatedIf:
459
457
  Description: >-
460
458
  Favor unless over if for negative conditions
@@ -475,24 +473,24 @@ Style/NegatedIf:
475
473
  Style/NilComparison:
476
474
  Description: 'Prefer x.nil? to x == nil.'
477
475
  StyleGuide: '#predicate-methods'
478
- Enabled: false
476
+ Enabled: true
479
477
  VersionAdded: '0.12'
480
478
  VersionChanged: '0.59'
481
- EnforcedStyle: predicate
479
+ EnforcedStyle: comparison
482
480
  SupportedStyles:
483
481
  - predicate
484
482
  - comparison
485
483
 
486
- Style/NumericLiterals:
487
- Description: >-
488
- Add underscores to large numeric literals to improve their
489
- readability.
490
- StyleGuide: '#underscores-in-numerics'
491
- Enabled: false
492
- VersionAdded: '0.9'
493
- VersionChanged: '0.48'
494
- MinDigits: 5
495
- Strict: false
484
+ # Style/NumericLiterals:
485
+ # Description: >-
486
+ # Add underscores to large numeric literals to improve their
487
+ # readability.
488
+ # StyleGuide: '#underscores-in-numerics'
489
+ # Enabled: false
490
+ # VersionAdded: '0.9'
491
+ # VersionChanged: '0.48'
492
+ # MinDigits: 5
493
+ # Strict: false
496
494
 
497
495
 
498
496
  Style/NumericPredicate:
@@ -535,6 +533,7 @@ Style/PercentLiteralDelimiters:
535
533
  '%W': '[]'
536
534
  VersionChanged: '0.48.1'
537
535
 
536
+ # wyjaśnienie: do przemyślenia (choć self. wydaje mi się ok)
538
537
  Style/RedundantSelf:
539
538
  Description: "Don't use self where it's not needed."
540
539
  StyleGuide: '#no-self-unless-required'
@@ -560,19 +559,19 @@ Style/StringLiterals:
560
559
  # # use the same type of quotes on each line.
561
560
  # ConsistentQuotesInMultiline: false
562
561
 
562
+ # Style/SymbolArray:
563
+ # Description: 'Use %i or %I for arrays of symbols.'
564
+ # StyleGuide: '#percent-i'
565
+ # Enabled: false
566
+ # VersionAdded: '0.9'
567
+ # VersionChanged: '0.49'
568
+ # EnforcedStyle: percent
569
+ # MinSize: 2
570
+ # SupportedStyles:
571
+ # - percent
572
+ # - brackets
563
573
 
564
- Style/SymbolArray:
565
- Description: 'Use %i or %I for arrays of symbols.'
566
- StyleGuide: '#percent-i'
567
- Enabled: false
568
- VersionAdded: '0.9'
569
- VersionChanged: '0.49'
570
- EnforcedStyle: percent
571
- MinSize: 2
572
- SupportedStyles:
573
- - percent
574
- - brackets
575
-
574
+ # wyjaśnienie: to przemyślenia
576
575
  Style/SymbolProc:
577
576
  Description: 'Use symbols as procs instead of blocks when possible.'
578
577
  Enabled: false
@@ -643,11 +642,12 @@ Style/GuardClause:
643
642
  # needs to have to trigger this cop
644
643
  MinBodyLength: 4
645
644
 
646
- Lint/DuplicateBranch:
647
- Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
648
- Enabled: false
649
- VersionAdded: '1.3'
645
+ # Lint/DuplicateBranch:
646
+ # Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
647
+ # Enabled: false
648
+ # VersionAdded: '1.3'
650
649
 
650
+ # wyjaśnienie: lepsze jest `var_name = $2 || $1` niż `var_name = ::Regexp.last_match(2) || ::Regexp.last_match(1)`
651
651
  Style/PerlBackrefs:
652
652
  Description: 'Avoid Perl-style regex back references.'
653
653
  StyleGuide: '#no-perl-regexp-last-matchers'
@@ -656,23 +656,24 @@ Style/PerlBackrefs:
656
656
 
657
657
  Style/ZeroLengthPredicate:
658
658
  Description: 'Use #empty? when testing for objects of length 0.'
659
- Enabled: false
660
- Safe: false
659
+ Enabled: true
660
+ Safe: true
661
661
  VersionAdded: '0.37'
662
662
  VersionChanged: '0.39'
663
663
 
664
- Style/AccessModifierDeclarations:
665
- Description: 'Checks style of how access modifiers are used.'
666
- Enabled: false
667
- VersionAdded: '0.57'
668
- VersionChanged: '0.81'
669
- EnforcedStyle: inline
670
- SupportedStyles:
671
- - inline
672
- - group
673
- AllowModifiersOnSymbols: true
674
- Style/MapToHash:
675
- Enabled: false
664
+ # Style/AccessModifierDeclarations:
665
+ # Description: 'Checks style of how access modifiers are used.'
666
+ # Enabled: false
667
+ # VersionAdded: '0.57'
668
+ # VersionChanged: '0.81'
669
+ # EnforcedStyle: inline
670
+ # SupportedStyles:
671
+ # - inline
672
+ # - group
673
+ # AllowModifiersOnSymbols: true
674
+
675
+ # Style/MapToHash:
676
+ # Enabled: false
676
677
 
677
678
  # Style/RegexpLiteral:
678
679
  # Description: 'Use / or %r around regular expressions.'
@@ -692,6 +693,31 @@ Style/MapToHash:
692
693
  # # are found in the regexp string.
693
694
  # AllowInnerSlashes: false
694
695
 
696
+ Style/HashSyntax:
697
+ EnforcedShorthandSyntax: 'either'
698
+
699
+ # Style/FetchEnvVar:
700
+ # Enabled: false
701
+
702
+ # wyjaśnienie: do włączenia
703
+ Style/MethodCallWithArgsParentheses:
704
+ Enabled: false
705
+ # AllowedMethods:
706
+ # - require
707
+ # - require_relative
708
+ # - require_dependency
709
+ # - yield
710
+ # - raise
711
+ # - puts
712
+ # Exclude:
713
+ # - "/**/Gemfile"
714
+
715
+ Style/ClassMethodsDefinitions:
716
+ EnforcedStyle: def_self
717
+
718
+ Style/TrailingCommaInArguments:
719
+ EnforcedStyleForMultiline: no_comma
720
+
695
721
 
696
722
  ###### RAILS ######
697
723
  ###### RAILS ######
@@ -707,15 +733,18 @@ Rails/UnknownEnv:
707
733
  - development
708
734
  - test
709
735
 
710
- Rails/FilePath:
711
- Enabled: false
736
+ # Rails/FilePath:
737
+ # Enabled: false
712
738
 
739
+ # wyjaśnienie: zwykla metoda wydaje sie lepsza niz nowa skladnia `delegate`
713
740
  Rails/Delegate:
714
741
  Enabled: false
715
742
 
743
+ # wyjaśnienie: lepiej wygląda `![a:, :b].include?(:a)` niż `[:a, :b].exclude?(:a)`
716
744
  Rails/NegateInclude:
717
745
  Enabled: false
718
746
 
747
+ # wyjaśnienie: do ustalenia
719
748
  Rails/SkipsModelValidations:
720
749
  Enabled: false
721
750
 
@@ -723,68 +752,32 @@ Rails/SkipsModelValidations:
723
752
  # Enabled: true
724
753
  # SafeAutoCorrect: false
725
754
 
726
- ## MINITEST
727
-
728
- Minitest/TestMethodName:
729
- Enabled: false
730
-
731
- Minitest/AssertWithExpectedArgument:
732
- Enabled: false
733
-
734
- Minitest/MultipleAssertions:
735
- Enabled: false
736
-
737
- ## PERFORMANCE
738
-
739
- Performance/CollectionLiteralInLoop:
755
+ # wyjaśnienie: do ustalenia
756
+ Rails/ReversibleMigration:
740
757
  Enabled: false
741
758
 
742
- Naming/InclusiveLanguage:
743
- Enabled: false
759
+ Rails/WhereExists:
760
+ EnforcedStyle: where
744
761
 
745
- Rails/ReversibleMigration:
746
- Enabled: false
762
+ ## MINITEST
747
763
 
748
- # ruby 3.1 (na razie wyłączamy)
764
+ # Minitest/TestMethodName:
765
+ # Enabled: false
749
766
 
750
- Style/HashSyntax:
751
- EnforcedShorthandSyntax: 'either'
767
+ # Minitest/AssertWithExpectedArgument:
768
+ # Enabled: false
752
769
 
753
- Naming/BlockForwarding:
770
+ Minitest/MultipleAssertions:
754
771
  Enabled: false
755
772
 
756
773
  Minitest/AssertPredicate:
757
774
  Enabled: false
758
775
 
759
- # TODO: do włączenia
760
- Rails/I18nLocaleTexts:
776
+ Minitest/AssertInDelta:
761
777
  Enabled: false
762
778
 
763
- Style/FetchEnvVar:
764
- Enabled: false
765
-
766
- Layout/ParameterAlignment:
767
- EnforcedStyle: with_fixed_indentation
779
+ ## PERFORMANCE
768
780
 
769
- Style/MethodCallWithArgsParentheses:
781
+ Performance/CollectionLiteralInLoop:
770
782
  Enabled: false
771
- # AllowedMethods:
772
- # - require
773
- # - require_relative
774
- # - require_dependency
775
- # - yield
776
- # - raise
777
- # - puts
778
- # Exclude:
779
- # - "/**/Gemfile"
780
783
 
781
- Rails/WhereExists:
782
- EnforcedStyle: where
783
- Enabled: true
784
-
785
- Style/ClassMethodsDefinitions:
786
- EnforcedStyle: def_self
787
- Enabled: true
788
-
789
- Style/TrailingCommaInArguments:
790
- EnforcedStyleForMultiline: no_comma
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-intum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2022-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop-shopify