Skip to content

Commit 8f51669

Browse files
authored
Drop StringLiterals cop suppression (#881)
Removes the suppression of the `StringLiterals` cop and switches all strings to the format the follows the cop: double quotes if using interpolation or containing a single quote, single quotes otherwise. I got this by running `bundle exec rubocop -a`.
1 parent d9b1f89 commit 8f51669

File tree

9 files changed

+20
-23
lines changed

9 files changed

+20
-23
lines changed

resources/asciidoctor/.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,3 @@ Metrics/PerceivedComplexity:
2828

2929
Style/NestedParenthesizedCalls:
3030
Enabled: false
31-
32-
Style/StringLiterals:
33-
Enabled: false

resources/asciidoctor/lib/edit_me/extension.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ class EditMe < TreeProcessorScaffold
1111
include Asciidoctor::Logging
1212

1313
def process(document)
14-
logger.error("sourcemap is required") unless document.sourcemap
14+
logger.error('sourcemap is required') unless document.sourcemap
1515
edit_urls_string = document.attributes['edit_urls']
1616
return unless edit_urls_string
1717

1818
edit_urls = []
1919
CSV.parse edit_urls_string do |toplevel, url|
2020
unless toplevel
21-
logger.error message_with_context "invalid edit_urls, no toplevel"
21+
logger.error message_with_context 'invalid edit_urls, no toplevel'
2222
next
2323
end
2424
unless url
25-
logger.error message_with_context "invalid edit_urls, no url"
25+
logger.error message_with_context 'invalid edit_urls, no url'
2626
next
2727
end
2828
url = url[0..-2] if url.end_with? '/'

resources/asciidoctor/spec/care_admonition_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
expect(converted).to include(expected)
5151
end
5252
end
53-
context "when written without the ::" do
53+
context 'when written without the ::' do
5454
let(:input) do
5555
<<~ASCIIDOC
5656
== Example

resources/asciidoctor/spec/copy_images_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
let(:resources_dir) { "#{spec_dir}/resources/copy_images" }
5050

5151
# Full relative path to example images
52-
let(:example1) { "resources/copy_images/example1.png" }
53-
let(:example2) { "resources/copy_images/example2.png" }
52+
let(:example1) { 'resources/copy_images/example1.png' }
53+
let(:example2) { 'resources/copy_images/example2.png' }
5454

5555
##
5656
# Asserts that a particular `image_command` copies the appropriate image
@@ -148,8 +148,8 @@
148148
let(:resolved) { 'example1.png' }
149149
it 'logs an error' do
150150
expect(logs).to include(
151-
"ERROR: <stdin>: line 2: Error loading [resources]: " \
152-
"Unclosed quoted field on line 1."
151+
'ERROR: <stdin>: line 2: Error loading [resources]: ' \
152+
'Unclosed quoted field on line 1.'
153153
)
154154
end
155155
end

resources/asciidoctor/spec/edit_me_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def spec_dir_link(file)
114114
context 'for a document with a preface' do
115115
include_context 'preface'
116116
it "doesn't add a link to the preface" do
117-
expect(converted).to include("<title>Preface</title>")
117+
expect(converted).to include('<title>Preface</title>')
118118
end
119119
end
120120

resources/asciidoctor/spec/elastic_compat_preprocessor_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@
7878
expect(converted).to include("<phrase #{phrase}/>")
7979
end
8080
end
81-
context "when the admonition is surrounded by other text" do
81+
context 'when the admonition is surrounded by other text' do
8282
let(:input) { "words #{invocation} words" }
8383
include_examples 'invokes the inline macro'
8484
end
85-
context "when the admonition has text before it" do
85+
context 'when the admonition has text before it' do
8686
let(:input) { "words #{invocation}" }
8787
include_examples 'invokes the inline macro'
8888
end
89-
context "when the admonition has text after it" do
89+
context 'when the admonition has text after it' do
9090
let(:input) { "#{invocation} words" }
9191
include_examples 'invokes the inline macro'
9292
end
@@ -406,7 +406,7 @@
406406
it "has the #{lang} language" do
407407
expect(converted).to match(has_lang)
408408
end
409-
it "have a link to the snippet" do
409+
it 'have a link to the snippet' do
410410
expect(converted).to match(has_link_to_path)
411411
end
412412
end
@@ -453,10 +453,10 @@
453453
include_context 'general snippet', 'js', nil
454454
let(:has_any_link) { /<ulink type="snippet"/ }
455455

456-
it "has the js language" do
456+
it 'has the js language' do
457457
expect(converted).to match(has_lang)
458458
end
459-
it "not have a link to any snippet" do
459+
it 'not have a link to any snippet' do
460460
expect(converted).not_to match(has_any_link)
461461
end
462462
end

resources/asciidoctor/spec/elastic_compat_tree_processor_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
ASCIIDOC
8787
end
8888
include_examples 'has the expected language'
89-
it "the paragraph is intact" do
89+
it 'the paragraph is intact' do
9090
expect(converted).to match(%r{<simpara>Words words words.</simpara>})
9191
end
9292
end
@@ -113,7 +113,7 @@
113113
ASCIIDOC
114114
end
115115
include_examples 'has the expected language'
116-
it "has a working callout list" do
116+
it 'has a working callout list' do
117117
expect(converted).to match(/<callout arearefs="CO1-1">\n<para>foo/)
118118
end
119119
end

resources/asciidoctor/spec/shared_examples/does_not_break_line_numbers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<1> callout
1212
ASCIIDOC
1313
end
14-
it "reports the right line for the error" do
14+
it 'reports the right line for the error' do
1515
expect(logs).to eq('WARN: <stdin>: line 3: no callout found for <1>')
1616
end
1717
end
@@ -22,7 +22,7 @@
2222
end
2323
let(:input) { "include::#{included}[]" }
2424
let(:expected) { "WARN: #{included}: line 3: no callout found for <1>" }
25-
it "reports the right line for the error" do
25+
it 'reports the right line for the error' do
2626
expect(logs).to eq(expected)
2727
end
2828
end

resources/asciidoctor/spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RSpec.configure do |config|
44
# Enable flags like --only-failures and --next-failure
5-
config.example_status_persistence_file_path = ".rspec_status"
5+
config.example_status_persistence_file_path = '.rspec_status'
66

77
# Disable RSpec exposing methods globally on `Module` and `main`
88
config.disable_monkey_patching!

0 commit comments

Comments
 (0)