rubocop-performance 1.26.0 → 1.26.1
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 +4 -4
- data/config/default.yml +2 -1
- data/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb +1 -1
- data/lib/rubocop/cop/performance/big_decimal_with_numeric_argument.rb +5 -0
- data/lib/rubocop/cop/performance/redundant_string_chars.rb +1 -0
- data/lib/rubocop/performance/version.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c834e1a3af5e4cc42c7edd0dfe6bdb4e4cfc6e665e2235277f46b15cdb9ab720
|
4
|
+
data.tar.gz: a1e5d0efde3b42af4f7d6293e5595ca30df2d24d7cfb765d6ec87932a331d2ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127936d00884ae6749b2b5511466c09dd696662d02bd34b581582e71e3966f9228f4d8e8ff880db96ff7267023dbfd87a5121888e95c41afea930ee98f6d30c3
|
7
|
+
data.tar.gz: b6cc50f7db2771e41c6700238fe175a5273916ab7da2c3ab487648aa801d04914afa3f0564f67205d2eba436dc694d4cb011fee72e878dffc2c202bcf8a1f011
|
data/config/default.yml
CHANGED
@@ -22,8 +22,9 @@ Performance/ArraySemiInfiniteRangeSlice:
|
|
22
22
|
|
23
23
|
Performance/BigDecimalWithNumericArgument:
|
24
24
|
Description: 'Convert numeric literal to string and pass it to `BigDecimal`.'
|
25
|
-
Enabled:
|
25
|
+
Enabled: false
|
26
26
|
VersionAdded: '1.7'
|
27
|
+
VersionChanged: '1.26'
|
27
28
|
|
28
29
|
Performance/BindCall:
|
29
30
|
Description: 'Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`.'
|
@@ -39,7 +39,7 @@ module RuboCop
|
|
39
39
|
RESTRICT_ON_SEND = SLICE_METHODS
|
40
40
|
|
41
41
|
def_node_matcher :endless_range_slice?, <<~PATTERN
|
42
|
-
(call $!
|
42
|
+
(call $!any_str $%SLICE_METHODS $#endless_range?)
|
43
43
|
PATTERN
|
44
44
|
|
45
45
|
def_node_matcher :endless_range?, <<~PATTERN
|
@@ -9,6 +9,11 @@ module RuboCop
|
|
9
9
|
# Also identifies places where an integer string argument to BigDecimal should be converted to
|
10
10
|
# an integer. Initializing from Integer is faster than from String for BigDecimal.
|
11
11
|
#
|
12
|
+
# NOTE: This cop is disabled by default because the performance of initializing with a String
|
13
|
+
# and Number differ between versions. Additionally, performance depends on the size of the Number,
|
14
|
+
# and if it is an Integer or a Float. Since this is very specific to `bigdecimal` internals,
|
15
|
+
# suggestions from this cop are not unlikely to result in code that performs worse than before.
|
16
|
+
#
|
12
17
|
# @example
|
13
18
|
# # bad
|
14
19
|
# BigDecimal(1.2, 3, exception: true)
|
@@ -54,6 +54,7 @@ module RuboCop
|
|
54
54
|
def on_send(node)
|
55
55
|
return unless (receiver, method, args = redundant_chars_call?(node))
|
56
56
|
return if method == :last && !args.empty?
|
57
|
+
return if args.count == 2
|
57
58
|
|
58
59
|
range = offense_range(receiver, node)
|
59
60
|
message = build_message(method, args)
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-performance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.26.
|
4
|
+
version: 1.26.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
- Jonas Arvidsson
|
9
9
|
- Yuji Nakayama
|
10
|
+
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2025-10-18 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: lint_roller
|
@@ -51,7 +52,7 @@ dependencies:
|
|
51
52
|
requirements:
|
52
53
|
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
55
|
+
version: 1.47.1
|
55
56
|
- - "<"
|
56
57
|
- !ruby/object:Gem::Version
|
57
58
|
version: '2.0'
|
@@ -61,7 +62,7 @@ dependencies:
|
|
61
62
|
requirements:
|
62
63
|
- - ">="
|
63
64
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.
|
65
|
+
version: 1.47.1
|
65
66
|
- - "<"
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '2.0'
|
@@ -149,6 +150,7 @@ metadata:
|
|
149
150
|
bug_tracker_uri: https://github.com/rubocop/rubocop-performance/issues
|
150
151
|
rubygems_mfa_required: 'true'
|
151
152
|
default_lint_roller_plugin: RuboCop::Performance::Plugin
|
153
|
+
post_install_message:
|
152
154
|
rdoc_options: []
|
153
155
|
require_paths:
|
154
156
|
- lib
|
@@ -163,7 +165,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
165
|
- !ruby/object:Gem::Version
|
164
166
|
version: '0'
|
165
167
|
requirements: []
|
166
|
-
rubygems_version: 3.6
|
168
|
+
rubygems_version: 3.1.6
|
169
|
+
signing_key:
|
167
170
|
specification_version: 4
|
168
171
|
summary: Automatic performance checking tool for Ruby code.
|
169
172
|
test_files: []
|