Skip to content

Commit 6c34ac8

Browse files
committed
Fix Rubocop issues
1 parent 7600117 commit 6c34ac8

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ AllCops:
1212
SuggestExtensions: false
1313
TargetRubyVersion: 3.2
1414

15+
Layout/MultilineMethodCallIndentation:
16+
Enabled: true
17+
EnforcedStyle: indented
18+
1519
Lint/MissingSuper:
1620
Enabled: false
1721

spec/shared_specs/i18n_value_translation_safety.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# frozen_string_literal: true
22

3-
RSpec.shared_context 'i18n value base matrix' do
3+
RSpec.shared_context 'with i18n value base matrix' do
44
let(:safe_input) { 't(admin.my_text)' }
55
let(:quoted_safe_input) { 't( "admin.my_text" )' }
66
let(:expected_translation) { 'My Text' }
77
let(:plain_input) { 'Regular label' }
88
end
99

10-
RSpec.shared_context 'i18n value malformed payload matrix' do
10+
RSpec.shared_context 'with i18n value malformed payload matrix' do
1111
let(:malformed_payloads) do
1212
[
1313
"t(admin.my_text, default: 'fallback')",
@@ -19,20 +19,20 @@
1919
end
2020
end
2121

22-
RSpec.shared_context 'i18n value malicious payload matrix' do
22+
RSpec.shared_context 'with i18n value malicious payload matrix' do
2323
let(:malicious_payloads) do
2424
[
2525
"t(Kernel.system('echo pwned'))",
2626
't(File.read("/etc/passwd"))',
27-
"t(%x[echo pwned])"
27+
't(%x[echo pwned])'
2828
]
2929
end
3030
end
3131

3232
RSpec.shared_examples 'i18n value translation safety' do
33-
include_context 'i18n value base matrix'
34-
include_context 'i18n value malformed payload matrix'
35-
include_context 'i18n value malicious payload matrix'
33+
include_context 'with i18n value base matrix'
34+
include_context 'with i18n value malformed payload matrix'
35+
include_context 'with i18n value malicious payload matrix'
3636

3737
it 'translates safe i18n key expressions' do
3838
expect(render_i18n_value(safe_input)).to eq(expected_translation)

0 commit comments

Comments
 (0)