rubocop-thread_safety 0.4.3 → 0.4.4
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f779f952ad93ee231e590b53de736e1aa6f8bfc421032e1093e495a6a1b58d5
|
|
4
|
+
data.tar.gz: 31afd6b2f36af51336751d2de2b31b794c61e64bd8363c71bde8750df1e0b728
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71ac5c818dce793fdf24c6cb7e3f486bf8e897e9a9f8066bdf8b2cd25ac6637060cf65314b25fa2d7f4450dccf55e0eb4310679d32a2488aeef545effa6b0c06
|
|
7
|
+
data.tar.gz: 3c90b593c9f948b1c75eec96edafeb14cb83934eae67e49fc032098cba86855fe5b39178c1f44376a6da05db994b8b8560bc0d4b48bf76239f3b6411474d5a24
|
|
@@ -77,6 +77,8 @@ module RuboCop
|
|
|
77
77
|
include ConfigurableEnforcedStyle
|
|
78
78
|
|
|
79
79
|
MSG = 'Freeze mutable objects assigned to class instance variables.'
|
|
80
|
+
FROZEN_STRING_LITERAL_TYPES_RUBY27 = %i[str dstr].freeze
|
|
81
|
+
FROZEN_STRING_LITERAL_TYPES_RUBY30 = %i[str].freeze
|
|
80
82
|
|
|
81
83
|
def on_ivasgn(node)
|
|
82
84
|
return unless in_class?(node)
|
|
@@ -127,6 +129,15 @@ module RuboCop
|
|
|
127
129
|
|
|
128
130
|
private
|
|
129
131
|
|
|
132
|
+
def frozen_string_literal?(node)
|
|
133
|
+
literal_types = if target_ruby_version >= 3.0
|
|
134
|
+
FROZEN_STRING_LITERAL_TYPES_RUBY30
|
|
135
|
+
else
|
|
136
|
+
FROZEN_STRING_LITERAL_TYPES_RUBY27
|
|
137
|
+
end
|
|
138
|
+
literal_types.include?(node.type) && frozen_string_literals_enabled?
|
|
139
|
+
end
|
|
140
|
+
|
|
130
141
|
def on_assignment(value)
|
|
131
142
|
if style == :strict
|
|
132
143
|
strict_check(value)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-thread_safety
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Gee
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|