rubocop-i18n 3.2.2 → 3.3.0
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/CHANGELOG.md +10 -1
- data/config/default.yml +3 -0
- data/lib/rubocop/cop/i18n/gettext/decorate_function_message.rb +8 -2
- data/lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_interpolation.rb +2 -0
- data/lib/rubocop/cop/i18n/gettext/decorate_string_formatting_using_percent.rb +2 -0
- data/lib/rubocop/i18n/version.rb +1 -1
- data/lib/rubocop-i18n.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79a0ea4dff33eb645765ecb336bfd91ae9f71df3e89c0f7da8782811288a5048
|
|
4
|
+
data.tar.gz: 36a8ed0edcf04627dcda92f1130248a9cfb8f0cc656025fd215a6df06e03203c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 303dcf21cad589cc440c0747046f52a5d8596d0fe0ccfffa4881ec41d883a693c09cf8cf1a8350da5772737b810acd07c795e9f6dbc2cfc859ef14c31e53e4f7
|
|
7
|
+
data.tar.gz: 4019909a59180f899d5926b24942cca47a6ba8da25f563eb103eaa7ebaaf2616374aa314dbb5be3cfe4fa2c53603709dcaa6a79c170e3710abc2140da3c8180b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
### [master (Unreleased)](https://github.com/rubocop/rubocop-i18n/compare/v3.
|
|
3
|
+
### [master (Unreleased)](https://github.com/rubocop/rubocop-i18n/compare/v3.3.0...master)
|
|
4
|
+
|
|
5
|
+
### [3.3.0](https://github.com/rubocop/rubocop-i18n/compare/v3.2.3...v3.3.0)
|
|
6
|
+
|
|
7
|
+
* Enable `DecorateStringFormattingUsingInterpolation` cop with RailsI18n.
|
|
8
|
+
* Fix an error when using `.call` shorthand syntax.
|
|
9
|
+
|
|
10
|
+
### [3.2.3](https://github.com/rubocop/rubocop-i18n/compare/v3.2.2...v3.2.3)
|
|
11
|
+
|
|
12
|
+
* Fix an error when `RuboCop::I18n::Version` is used.
|
|
4
13
|
|
|
5
14
|
### [3.2.2](https://github.com/rubocop/rubocop-i18n/compare/v3.2.1...v3.2.2)
|
|
6
15
|
|
data/config/default.yml
CHANGED
|
@@ -4,10 +4,14 @@ module RuboCop
|
|
|
4
4
|
module Cop
|
|
5
5
|
module I18n
|
|
6
6
|
module GetText
|
|
7
|
+
# rubocop:disable Metrics/ClassLength
|
|
7
8
|
class DecorateFunctionMessage < Base
|
|
8
9
|
extend AutoCorrector
|
|
9
10
|
|
|
11
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
|
10
12
|
def on_send(node)
|
|
13
|
+
return unless node.loc.selector
|
|
14
|
+
|
|
11
15
|
method_name = node.loc.selector.source
|
|
12
16
|
return unless GetText.supported_method?(method_name)
|
|
13
17
|
|
|
@@ -23,13 +27,14 @@ module RuboCop
|
|
|
23
27
|
detect_and_report(node, message_section, method_name)
|
|
24
28
|
end
|
|
25
29
|
end
|
|
30
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
|
26
31
|
|
|
27
32
|
private
|
|
28
33
|
|
|
29
34
|
def already_decorated?(node, parent = nil)
|
|
30
35
|
parent ||= node
|
|
31
36
|
|
|
32
|
-
if node.respond_to?(:loc) && node.loc
|
|
37
|
+
if node.respond_to?(:loc) && node.loc?(:selector)
|
|
33
38
|
return true if GetText.supported_decorator?(node.loc.selector.source)
|
|
34
39
|
end
|
|
35
40
|
|
|
@@ -91,7 +96,7 @@ module RuboCop
|
|
|
91
96
|
def concatenation_offense?(node, parent = nil)
|
|
92
97
|
parent ||= node
|
|
93
98
|
|
|
94
|
-
if node.respond_to?(:loc) && node.loc
|
|
99
|
+
if node.respond_to?(:loc) && node.loc?(:selector)
|
|
95
100
|
return true if node.loc.selector.source == '+'
|
|
96
101
|
end
|
|
97
102
|
|
|
@@ -150,6 +155,7 @@ module RuboCop
|
|
|
150
155
|
}
|
|
151
156
|
end
|
|
152
157
|
end
|
|
158
|
+
# rubocop:enable Metrics/ClassLength
|
|
153
159
|
end
|
|
154
160
|
end
|
|
155
161
|
end
|
data/lib/rubocop/i18n/version.rb
CHANGED
data/lib/rubocop-i18n.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-i18n
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
- Helen Campbell
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: lint_roller
|
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
97
|
version: '0'
|
|
98
98
|
requirements: []
|
|
99
|
-
rubygems_version:
|
|
99
|
+
rubygems_version: 4.0.6
|
|
100
100
|
specification_version: 4
|
|
101
101
|
summary: RuboCop rules for i18n
|
|
102
102
|
test_files: []
|