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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7a0f12f1f5a4d4bd02777c1b25493ecbeeb22123ab9303972dba417008663d4
4
- data.tar.gz: 03a822da901549b45baba2e0bd736dba254d4185f7475f78b5ca9f40ce373e5b
3
+ metadata.gz: 79a0ea4dff33eb645765ecb336bfd91ae9f71df3e89c0f7da8782811288a5048
4
+ data.tar.gz: 36a8ed0edcf04627dcda92f1130248a9cfb8f0cc656025fd215a6df06e03203c
5
5
  SHA512:
6
- metadata.gz: 6d9d2f449bb553912dd8bb21b2694d759f7538d5ac9dfa52da24e18f13178d267e16c5e3d7d163a3a1fb6a0808744a7bec1140ff62cb3a2f29f889fe012d4785
7
- data.tar.gz: 509e30770b84cc90854ccd8490370a4e7c756c0ae8da5a4c03fab87b939c879f507ea13c918a297be1891c1c17a97c59cdbfd24f6df03381df672fd6f6604beb
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.2.2...master)
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
@@ -23,3 +23,6 @@ I18n/RailsI18n:
23
23
 
24
24
  I18n/RailsI18n/DecorateString:
25
25
  Enabled: true
26
+
27
+ I18n/RailsI18n/DecorateStringFormattingUsingInterpolation:
28
+ Enabled: true
@@ -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.respond_to?(:selector)
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.respond_to?(:selector)
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
@@ -24,6 +24,8 @@ module RuboCop
24
24
  #
25
25
  class DecorateStringFormattingUsingInterpolation < Base
26
26
  def on_send(node)
27
+ return unless node.loc.selector
28
+
27
29
  decorator_name = node.loc.selector.source
28
30
  return unless GetText.supported_decorator?(decorator_name)
29
31
 
@@ -27,6 +27,8 @@ module RuboCop
27
27
  SUPPORTED_FORMATS = %w[b B d i o u x X e E f g G a A c p s].freeze
28
28
 
29
29
  def on_send(node)
30
+ return unless node.loc.selector
31
+
30
32
  decorator_name = node.loc.selector.source
31
33
  return unless GetText.supported_decorator?(decorator_name)
32
34
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module I18n
5
- VERSION = '3.2.2'
5
+ VERSION = '3.3.0'
6
6
  end
7
7
  end
data/lib/rubocop-i18n.rb CHANGED
@@ -3,5 +3,6 @@
3
3
  require 'rubocop'
4
4
 
5
5
  require_relative 'rubocop/i18n'
6
+ require_relative 'rubocop/i18n/version'
6
7
  require_relative 'rubocop/i18n/plugin'
7
8
  require_relative 'rubocop/cop/i18n_cops'
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.2.2
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: 2025-03-03 00:00:00.000000000 Z
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: 3.6.2
99
+ rubygems_version: 4.0.6
100
100
  specification_version: 4
101
101
  summary: RuboCop rules for i18n
102
102
  test_files: []