rubomatic 1.0.0.pre.rc.2 → 1.0.0.pre.rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3ada84f77d72e9c013db6deb061bcda7442a403ec51444ad06f0e2a052b05be
4
- data.tar.gz: 49c1269ecaaf1b1beaed4c285f0b2e607e7147e055aa9fa12d7febd1a21807e8
3
+ metadata.gz: a9262e25d628119d818abdc947c6de36fa78e28acd989c346e799fd16a49e70c
4
+ data.tar.gz: e63f62b52fb4b7feb81febe7d1bb965cf60413474fd7734ad37c0a19c3ca9c53
5
5
  SHA512:
6
- metadata.gz: 49fec9a0244cd5f1c73e3ad14ea33acfab8a42a32f345acb58ea027b98ac30e5474b7b5292116615aa24db4e08451eda5eda39c504b01f14245ed4f4ca31cb18
7
- data.tar.gz: eecfb7001751186cb06b73ee9be773db2fe6802090bafcc5fda8de05e985810456e9eb0c952d68bfaf9c775eebff05e6c3a63db522b4ab9ac0614fdff50d9a4b
6
+ metadata.gz: 8e88be2f9b8880c5b530f9b0a93c120fc92e328d0361eb015954b14be893aea8d351db1193a30f73bf31120e75dbb824e9bf63999f90564bfe2b255687985957
7
+ data.tar.gz: cddeb0f472f82cc66edd79e6cfcc98274bbbfdeb3840be65fe372454d9415821862c854e00d3d8f91c0633700782e13f19b2e75cda58aa1c6ce96358aee6d479
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/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."
@@ -1763,6 +1775,7 @@ Style/RandomWithOffset:
1763
1775
  Enabled: true
1764
1776
  VersionAdded: '0.52'
1765
1777
 
1778
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
1766
1779
  Style/RedundantArgument:
1767
1780
  Description: 'Check for a redundant argument passed to certain methods.'
1768
1781
  Enabled: true
@@ -1776,6 +1789,7 @@ Style/RedundantArgument:
1776
1789
  split:
1777
1790
  chomp:
1778
1791
  chomp!:
1792
+ <% end %>
1779
1793
 
1780
1794
  Style/RedundantAssignment:
1781
1795
  Description: 'Checks for redundant assignment before returning.'
@@ -1804,15 +1818,19 @@ Style/RedundantConditional:
1804
1818
  Enabled: true
1805
1819
  VersionAdded: '0.50'
1806
1820
 
1821
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
1807
1822
  Style/RedundantConstantBase:
1808
1823
  Description: Avoid redundant `::` prefix on constant.
1809
1824
  Enabled: true
1810
1825
  VersionAdded: '1.40'
1826
+ <% end %>
1811
1827
 
1828
+ <% if RuboCop::Version.document_version.to_f >= 1.41 %>
1812
1829
  Style/RedundantDoubleSplatHashBraces:
1813
1830
  Description: 'Checks for redundant uses of double splat hash braces.'
1814
1831
  Enabled: true
1815
1832
  VersionAdded: '1.41'
1833
+ <% end %>
1816
1834
 
1817
1835
  Style/RedundantEach:
1818
1836
  Description: 'Checks for redundant `each`.'
@@ -1854,10 +1872,12 @@ Style/RedundantFreeze:
1854
1872
  VersionAdded: '0.34'
1855
1873
  VersionChanged: '0.66'
1856
1874
 
1875
+ <% if RuboCop::Version.document_version.to_f >= 1.45 %>
1857
1876
  Style/RedundantHeredocDelimiterQuotes:
1858
1877
  Description: 'Checks for redundant heredoc delimiter quotes.'
1859
1878
  Enabled: true
1860
1879
  VersionAdded: '1.45'
1880
+ <% end %>
1861
1881
 
1862
1882
  Style/RedundantInitialize:
1863
1883
  Description: 'Checks for redundant `initialize` methods.'
@@ -1959,11 +1979,13 @@ Style/RegexpLiteral:
1959
1979
  # are found in the regexp string.
1960
1980
  AllowInnerSlashes: false
1961
1981
 
1982
+ <% if RuboCop::Version.document_version.to_f >= 1.40 %>
1962
1983
  Style/RequireOrder:
1963
1984
  Description: Sort `require` and `require_relative` in alphabetical order.
1964
1985
  Enabled: true
1965
1986
  SafeAutoCorrect: false
1966
1987
  VersionAdded: '1.40'
1988
+ <% end %>
1967
1989
 
1968
1990
  Style/RescueModifier:
1969
1991
  Description: 'Avoid using rescue in its modifier form.'
@@ -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.3'
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance