rubomatic 1.0.0.pre.rc.2 → 1.0.0.pre.rc.4

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: a3ada84f77d72e9c013db6deb061bcda7442a403ec51444ad06f0e2a052b05be
4
- data.tar.gz: 49c1269ecaaf1b1beaed4c285f0b2e607e7147e055aa9fa12d7febd1a21807e8
3
+ metadata.gz: 68eb4e1278acd31b2830eff4d97844752ec725f0257d2e022d52c04cae42eb52
4
+ data.tar.gz: eb9032ab9a57e110bca7cec573707b84b1c4a06f4cb2e56f4a93cdccd64d9431
5
5
  SHA512:
6
- metadata.gz: 49fec9a0244cd5f1c73e3ad14ea33acfab8a42a32f345acb58ea027b98ac30e5474b7b5292116615aa24db4e08451eda5eda39c504b01f14245ed4f4ca31cb18
7
- data.tar.gz: eecfb7001751186cb06b73ee9be773db2fe6802090bafcc5fda8de05e985810456e9eb0c952d68bfaf9c775eebff05e6c3a63db522b4ab9ac0614fdff50d9a4b
6
+ metadata.gz: 3b56f4382aa04beadf049abdfa621a8b7df618755c056f5b5513decaf5352b57e07e07ba8d12c38025f1c809b3aef530061657114fe836caeddad5672ebe3040
7
+ data.tar.gz: fc0b70c7af7fbb3f9d682da62d631ced483dd41c7650c1e526dbc3ff0135108c4d6738a19235e3001b1a157d6e6365f9885d621c5a4b4f2385a1d5052b9c5ac1
data/CHANGELOG.adoc CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  * Initial public release
4
4
 
5
+ === Dependencies
6
+
7
+ * `rubocop@1.45.0`
8
+ * `rubocop-brands_insurance@1.1.0`
9
+ * `rubocop-performance@1.16.0`
10
+ * `rubocop-rails@2.18`
11
+
5
12
  == 0.0.1
6
13
 
7
14
  * Initial release
data/LICENSE.txt CHANGED
@@ -1,7 +1,5 @@
1
1
  Copyright (c) 2012-23 Brands Insurance
2
2
 
3
- Copyright for portions of project Rubocop are held by Bozhidar Batsov and other contributors, as part of project Rubocop.
4
-
5
3
  Permission is hereby granted, free of charge, to any person obtaining
6
4
  a copy of this software and associated documentation files (the
7
5
  "Software"), to deal in the Software without restriction, including
data/configs/layout.yml CHANGED
@@ -65,7 +65,6 @@ Layout/AssignmentIndentation:
65
65
  Checks the indentation of the first line of the
66
66
  right-hand-side of a multi-line assignment.
67
67
  Enabled: true
68
- SafeAutoCorrect: false
69
68
  VersionAdded: '0.49'
70
69
  VersionChanged: '1.40'
71
70
 
@@ -700,7 +699,6 @@ Layout/LineContinuationLeadingSpace:
700
699
  broken over multiple lines (by a backslash).
701
700
  Enabled: true
702
701
  AutoCorrect: false
703
- SafeAutoCorrect: false
704
702
  VersionAdded: '1.31'
705
703
  VersionChanged: '1.32'
706
704
  EnforcedStyle: trailing
data/configs/lint.yml CHANGED
@@ -956,10 +956,12 @@ Lint/UselessMethodDefinition:
956
956
  VersionChanged: '0.91'
957
957
  Safe: false
958
958
 
959
+ <% if RuboCop::Version.version.to_f >= 1.43 %>
959
960
  Lint/UselessRescue:
960
961
  Description: 'Checks for useless `rescue`s, which only reraise rescued exceptions.'
961
962
  Enabled: true
962
963
  VersionAdded: '1.43'
964
+ <% end %>
963
965
 
964
966
  Lint/UselessRuby2Keywords:
965
967
  Description: 'Finds unnecessary uses of `ruby2_keywords`.'
@@ -2,127 +2,263 @@ Performance:
2
2
  Enabled: false
3
3
 
4
4
  Performance/BigDecimalWithNumericArgument:
5
+ Description: Convert numeric literal to string and pass it to `BigDecimal`.
5
6
  Enabled: true
7
+ VersionAdded: '1.7'
6
8
 
7
9
  Performance/ChainArrayAllocation:
10
+ Description: Instead of chaining array methods that allocate new arrays, mutate an
11
+ existing array.
12
+ Reference: https://twitter.com/schneems/status/1034123879978029057
8
13
  Enabled: true
14
+ VersionAdded: '0.59'
9
15
 
10
16
  Performance/CollectionLiteralInLoop:
17
+ Description: Extract Array and Hash literals outside of loops into local variables
18
+ or constants.
11
19
  Enabled: true
20
+ VersionAdded: '1.8'
12
21
  MinSize: 1
13
22
 
14
23
  Performance/CompareWithBlock:
24
+ Description: Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
15
25
  Enabled: true
26
+ VersionAdded: '0.46'
16
27
 
17
28
  Performance/ConstantRegexp:
29
+ Description: Finds regular expressions with dynamic components that are all constants.
18
30
  Enabled: true
31
+ VersionAdded: '1.9'
32
+ VersionChanged: '1.10'
19
33
 
20
34
  Performance/Count:
35
+ Description: Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
36
+ SafeAutoCorrect: false
21
37
  Enabled: true
38
+ VersionAdded: '0.31'
39
+ VersionChanged: '1.8'
22
40
 
23
41
  Performance/DeletePrefix:
42
+ Description: Use `delete_prefix` instead of `gsub`.
24
43
  Enabled: true
44
+ Safe: false
25
45
  SafeMultiline: false
46
+ VersionAdded: '1.6'
47
+ VersionChanged: '1.11'
26
48
 
27
49
  Performance/DeleteSuffix:
50
+ Description: Use `delete_suffix` instead of `gsub`.
28
51
  Enabled: true
52
+ Safe: false
29
53
  SafeMultiline: false
54
+ VersionAdded: '1.6'
55
+ VersionChanged: '1.11'
30
56
 
31
57
  Performance/Detect:
58
+ Description: Use `detect` instead of `select.first`, `find_all.first`, `filter.first`,
59
+ `select.last`, `find_all.last`, and `filter.last`.
60
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
61
+ SafeAutoCorrect: false
32
62
  Enabled: true
63
+ VersionAdded: '0.30'
64
+ VersionChanged: '1.8'
33
65
 
34
66
  Performance/DoubleStartEndWith:
67
+ Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
68
+ ...) || str.{start,end}_with?(y, ...)`.
35
69
  Enabled: true
70
+ VersionAdded: '0.36'
71
+ VersionChanged: '0.48'
36
72
  IncludeActiveSupportAliases: true
37
73
 
38
74
  Performance/EndWith:
75
+ Description: Use `end_with?` instead of a regex match anchored to the end of a string.
76
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
77
+ SafeAutoCorrect: false
39
78
  Enabled: true
40
79
  SafeMultiline: false
80
+ VersionAdded: '0.36'
81
+ VersionChanged: '1.10'
41
82
 
42
83
  Performance/FixedSize:
84
+ Description: Do not compute the size of statically sized objects except in constants.
43
85
  Enabled: true
86
+ VersionAdded: '0.35'
44
87
 
45
88
  Performance/FlatMap:
89
+ Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
90
+ or `Enumerable#collect..Array#flatten(1)`.
91
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
46
92
  Enabled: true
93
+ VersionAdded: '0.30'
47
94
  EnabledForFlattenWithoutParams: true
48
95
 
49
96
  Performance/InefficientHashSearch:
97
+ Description: Use `key?` or `value?` instead of `keys.include?` or `values.include?`.
98
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code
50
99
  Enabled: true
100
+ VersionAdded: '0.56'
101
+ Safe: false
51
102
 
52
103
  Performance/IoReadlines:
104
+ Description: Use `IO.each_line` (`IO#each_line`) instead of `IO.readlines` (`IO#readlines`).
105
+ Reference: https://docs.gitlab.com/ee/development/performance.html#reading-from-files-and-other-data-sources
53
106
  Enabled: true
107
+ VersionAdded: '1.7'
54
108
 
55
109
  Performance/MapCompact:
110
+ Description: Use `filter_map` instead of `collection.map(&:do_something).compact`.
56
111
  Enabled: true
112
+ SafeAutoCorrect: false
113
+ VersionAdded: '1.11'
57
114
 
58
115
  Performance/MethodObjectAsBlock:
116
+ Description: Use block explicitly instead of block-passing a method object.
117
+ Reference: https://github.com/JuanitoFatas/fast-ruby#normal-way-to-apply-method-vs-method-code
59
118
  Enabled: true
119
+ VersionAdded: '1.9'
60
120
 
61
121
  Performance/OpenStruct:
122
+ Description: Use `Struct` instead of `OpenStruct`.
62
123
  Enabled: true
124
+ VersionAdded: '0.61'
125
+ Safe: false
63
126
 
64
127
  Performance/RangeInclude:
128
+ Description: Use `Range#cover?` instead of `Range#include?` (or `Range#member?`).
129
+ Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
65
130
  Enabled: true
131
+ VersionAdded: '0.36'
132
+ VersionChanged: '1.7'
133
+ Safe: false
66
134
 
67
135
  Performance/RedundantBlockCall:
136
+ Description: Use `yield` instead of `block.call`.
137
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode
68
138
  Enabled: true
139
+ VersionAdded: '0.36'
69
140
 
70
141
  Performance/RedundantEqualityComparisonBlock:
142
+ Description: Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
143
+ or `Enumerable#none?` are compared with `===` or similar methods in block.
144
+ Reference: https://github.com/rails/rails/pull/41363
71
145
  Enabled: true
146
+ Safe: false
147
+ VersionAdded: '1.10'
72
148
 
73
149
  Performance/RedundantMatch:
150
+ Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
151
+ the returned `MatchData` is not needed.
74
152
  Enabled: true
153
+ VersionAdded: '0.36'
75
154
 
76
155
  Performance/RedundantMerge:
156
+ Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
157
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
77
158
  Enabled: true
159
+ Safe: false
160
+ VersionAdded: '0.36'
161
+ VersionChanged: '1.11'
78
162
  MaxKeyValuePairs: 2
79
163
 
80
164
  Performance/RedundantSortBlock:
165
+ Description: Use `sort` instead of `sort { |a, b| a <=> b }`.
81
166
  Enabled: true
167
+ VersionAdded: '1.7'
82
168
 
83
169
  Performance/RedundantSplitRegexpArgument:
170
+ Description: Identifies places where `split` argument can be replaced from a deterministic
171
+ regexp to a string.
84
172
  Enabled: true
173
+ VersionAdded: '1.10'
85
174
 
86
175
  Performance/RedundantStringChars:
176
+ Description: Checks for redundant `String#chars`.
87
177
  Enabled: true
178
+ VersionAdded: '1.7'
88
179
 
89
180
  Performance/RegexpMatch:
181
+ Description: Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
182
+ `Regexp#===`, or `=~` when `MatchData` is not used.
183
+ Reference: https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-
90
184
  Enabled: true
185
+ VersionAdded: '0.47'
91
186
 
92
187
  Performance/ReverseEach:
188
+ Description: Use `reverse_each` instead of `reverse.each`.
189
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
93
190
  Enabled: true
191
+ VersionAdded: '0.30'
94
192
 
95
193
  Performance/ReverseFirst:
194
+ Description: Use `last(n).reverse` instead of `reverse.first(n)`.
96
195
  Enabled: true
196
+ VersionAdded: '1.7'
97
197
 
98
198
  Performance/SelectMap:
199
+ Description: Use `filter_map` instead of `ary.select(&:foo).map(&:bar)`.
99
200
  Enabled: true
201
+ VersionAdded: '1.11'
100
202
 
101
203
  Performance/Size:
204
+ Description: Use `size` instead of `count` for counting the number of elements in
205
+ `Array` and `Hash`.
206
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code
102
207
  Enabled: true
208
+ VersionAdded: '0.30'
103
209
 
104
210
  Performance/SortReverse:
211
+ Description: Use `sort.reverse` instead of `sort { |a, b| b <=> a }`.
105
212
  Enabled: true
213
+ VersionAdded: '1.7'
106
214
 
107
215
  Performance/Squeeze:
216
+ Description: Use `squeeze('a')` instead of `gsub(/a+/, 'a')`.
217
+ Reference: https://github.com/JuanitoFatas/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code
108
218
  Enabled: true
219
+ VersionAdded: '1.7'
109
220
 
110
221
  Performance/StartWith:
222
+ Description: Use `start_with?` instead of a regex match anchored to the beginning
223
+ of a string.
224
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
225
+ SafeAutoCorrect: false
111
226
  Enabled: true
112
227
  SafeMultiline: false
228
+ VersionAdded: '0.36'
229
+ VersionChanged: '1.10'
113
230
 
114
231
  Performance/StringIdentifierArgument:
232
+ Description: Use symbol identifier argument instead of string identifier argument.
115
233
  Enabled: true
234
+ VersionAdded: '1.13'
116
235
 
117
236
  Performance/StringInclude:
237
+ Description: Use `String#include?` instead of a regex match with literal-only pattern.
118
238
  Enabled: true
239
+ SafeAutoCorrect: false
240
+ VersionAdded: '1.7'
241
+ VersionChanged: '1.12'
119
242
 
120
243
  Performance/StringReplacement:
244
+ Description: Use `tr` instead of `gsub` when you are replacing the same number of
245
+ characters. Use `delete` instead of `gsub` when you are deleting characters.
246
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
121
247
  Enabled: true
248
+ VersionAdded: '0.33'
122
249
 
123
250
  Performance/Sum:
251
+ Description: Use `sum` instead of a custom array summation.
252
+ SafeAutoCorrect: false
253
+ Reference: https://blog.bigbinary.com/2016/11/02/ruby-2-4-introduces-enumerable-sum.html
124
254
  Enabled: true
255
+ VersionAdded: '1.8'
256
+ VersionChanged: '1.13'
125
257
  OnlySumOrWithInitialValue: false
126
258
 
127
259
  Performance/TimesMap:
260
+ Description: Checks for .times.map calls.
128
261
  Enabled: true
262
+ SafeAutoCorrect: false
263
+ VersionAdded: '0.36'
264
+ VersionChanged: '1.13'
data/configs/style.yml CHANGED
@@ -62,10 +62,12 @@ Style/ArrayCoercion:
62
62
  Enabled: true
63
63
  VersionAdded: '0.88'
64
64
 
65
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
65
66
  Style/ArrayIntersect:
66
67
  Description: 'Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`.'
67
68
  Enabled: true
68
69
  VersionAdded: '1.40'
70
+ <% end %>
69
71
 
70
72
  Style/ArrayJoin:
71
73
  Description: 'Use Array#join instead of Array#*.'
@@ -445,16 +447,20 @@ Style/CommentedKeyword:
445
447
  VersionAdded: '0.51'
446
448
  VersionChanged: '1.19'
447
449
 
450
+ <% if RuboCop::Version.document_version.to_f >= 1.44 %>
448
451
  Style/ComparableClamp:
449
452
  Description: 'Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum.'
450
453
  Enabled: true
451
454
  VersionAdded: '1.44'
455
+ <% end %>
452
456
 
457
+ <% if RuboCop::Version.document_version.to_f >= 1.41 %>
453
458
  Style/ConcatArrayLiterals:
454
459
  Description: 'Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals.'
455
460
  Enabled: true
456
461
  Safe: false
457
462
  VersionAdded: '1.41'
463
+ <% end %>
458
464
 
459
465
  Style/ConditionalAssignment:
460
466
  Description: >-
@@ -534,11 +540,13 @@ Style/Dir:
534
540
  Enabled: true
535
541
  VersionAdded: '0.50'
536
542
 
537
- #Style/DirEmpty:
538
- # Description: >-
539
- # Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty.
540
- # Enabled: true
541
- # VersionAdded: '1.48'
543
+ <% if RuboCop::Version.document_version.to_f >= 1.48 %>
544
+ Style/DirEmpty:
545
+ Description: >-
546
+ Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty.
547
+ Enabled: true
548
+ VersionAdded: '1.48'
549
+ <% end %>
542
550
 
543
551
  Style/DisableCopsWithinSourceCodeDirective:
544
552
  Severity: info # Or warning
@@ -737,11 +745,13 @@ Style/FetchEnvVar:
737
745
  # Environment variables to be excluded from the inspection.
738
746
  AllowedVars: [ ]
739
747
 
740
- #Style/FileEmpty:
741
- # Description: >-
742
- # Prefer to use `File.empty?('path/to/file')` when checking if a file is empty.
743
- # Enabled: true
744
- # VersionAdded: '1.48'
748
+ <% if RuboCop::Version.document_version.to_f >= 1.48 %>
749
+ Style/FileEmpty:
750
+ Description: >-
751
+ Prefer to use `File.empty?('path/to/file')` when checking if a file is empty.
752
+ Enabled: true
753
+ VersionAdded: '1.48'
754
+ <% end %>
745
755
 
746
756
  Style/FileRead:
747
757
  Description: 'Favor `File.(bin)read` convenience methods.'
@@ -1065,6 +1075,7 @@ Style/InverseMethods:
1065
1075
  :select: :reject
1066
1076
  :select!: :reject!
1067
1077
 
1078
+ <% if RuboCop::Version.document_version.to_f >= 1.44 %>
1068
1079
  Style/InvertibleUnlessCondition:
1069
1080
  Description: 'Favor `if` with inverted condition over `unless`.'
1070
1081
  Enabled: true
@@ -1091,6 +1102,7 @@ Style/InvertibleUnlessCondition:
1091
1102
  :exclude?: :include?
1092
1103
  # :one?: :many?
1093
1104
  # :many?: :one?
1105
+ <% end %>
1094
1106
 
1095
1107
  Style/IpAddresses:
1096
1108
  Description: "Don't include literal IP addresses in code."
@@ -1804,15 +1816,19 @@ Style/RedundantConditional:
1804
1816
  Enabled: true
1805
1817
  VersionAdded: '0.50'
1806
1818
 
1819
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
1807
1820
  Style/RedundantConstantBase:
1808
1821
  Description: Avoid redundant `::` prefix on constant.
1809
1822
  Enabled: true
1810
1823
  VersionAdded: '1.40'
1824
+ <% end %>
1811
1825
 
1826
+ <% if RuboCop::Version.document_version.to_f >= 1.41 %>
1812
1827
  Style/RedundantDoubleSplatHashBraces:
1813
1828
  Description: 'Checks for redundant uses of double splat hash braces.'
1814
1829
  Enabled: true
1815
1830
  VersionAdded: '1.41'
1831
+ <% end %>
1816
1832
 
1817
1833
  Style/RedundantEach:
1818
1834
  Description: 'Checks for redundant `each`.'
@@ -1854,10 +1870,12 @@ Style/RedundantFreeze:
1854
1870
  VersionAdded: '0.34'
1855
1871
  VersionChanged: '0.66'
1856
1872
 
1873
+ <% if RuboCop::Version.document_version.to_f >= 1.45 %>
1857
1874
  Style/RedundantHeredocDelimiterQuotes:
1858
1875
  Description: 'Checks for redundant heredoc delimiter quotes.'
1859
1876
  Enabled: true
1860
1877
  VersionAdded: '1.45'
1878
+ <% end %>
1861
1879
 
1862
1880
  Style/RedundantInitialize:
1863
1881
  Description: 'Checks for redundant `initialize` methods.'
@@ -1959,11 +1977,13 @@ Style/RegexpLiteral:
1959
1977
  # are found in the regexp string.
1960
1978
  AllowInnerSlashes: false
1961
1979
 
1980
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
1962
1981
  Style/RequireOrder:
1963
1982
  Description: Sort `require` and `require_relative` in alphabetical order.
1964
1983
  Enabled: true
1965
1984
  SafeAutoCorrect: false
1966
1985
  VersionAdded: '1.40'
1986
+ <% end %>
1967
1987
 
1968
1988
  Style/RescueModifier:
1969
1989
  Description: 'Avoid using rescue in its modifier form.'
@@ -2256,7 +2276,6 @@ Style/SymbolProc:
2256
2276
  AllowedMethods:
2257
2277
  - define_method
2258
2278
  AllowedPatterns: [ ]
2259
- IgnoredMethods: [ ] # deprecated
2260
2279
  AllowComments: false
2261
2280
 
2262
2281
  Style/TernaryParentheses:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubomatic
4
- VERSION = '1.0.0-rc.2'
4
+ VERSION = '1.0.0-rc.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.rc.2
4
+ version: 1.0.0.pre.rc.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance