Skip to content
Snippets Groups Projects
Commit bdbc7d96 authored by Douwe Maan's avatar Douwe Maan
Browse files

Revert "Enable Style/BarePercentLiterals"

This reverts commit 96bef54154e669f9a3e92c3a4bc76c0be3a52e48.
parent 0beba025
No related branches found
No related tags found
No related merge requests found
Showing with 28 additions and 28 deletions
Loading
@@ -20,7 +20,7 @@ describe Banzai::Pipeline::FullPipeline do
Loading
@@ -20,7 +20,7 @@ describe Banzai::Pipeline::FullPipeline do
end end
   
it 'escapes the data-original attribute on a reference' do it 'escapes the data-original attribute on a reference' do
markdown = %{[">bad things](#{issue.to_reference})} markdown = %Q{[">bad things](#{issue.to_reference})}
result = described_class.to_html(markdown, project: project) result = described_class.to_html(markdown, project: project)
expect(result).to include(%{data-original='\">bad things'}) expect(result).to include(%{data-original='\">bad things'})
end end
Loading
Loading
Loading
@@ -22,19 +22,19 @@ describe Gitlab::Diff::Highlight, lib: true do
Loading
@@ -22,19 +22,19 @@ describe Gitlab::Diff::Highlight, lib: true do
end end
   
it 'highlights and marks unchanged lines' do it 'highlights and marks unchanged lines' do
code = %{ <span id="LC7" class="line"> <span class="k">def</span> <span class="nf">popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span></span>\n} code = %Q{ <span id="LC7" class="line"> <span class="k">def</span> <span class="nf">popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span></span>\n}
   
expect(subject[2].text).to eq(code) expect(subject[2].text).to eq(code)
end end
   
it 'highlights and marks removed lines' do it 'highlights and marks removed lines' do
code = %{-<span id="LC9" class="line"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n} code = %Q{-<span id="LC9" class="line"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n}
   
expect(subject[4].text).to eq(code) expect(subject[4].text).to eq(code)
end end
   
it 'highlights and marks added lines' do it 'highlights and marks added lines' do
code = %{+<span id="LC9" class="line"> <span class="k">raise</span> <span class="no"><span class='idiff left'>RuntimeError</span></span><span class="p"><span class='idiff'>,</span></span><span class='idiff right'> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n} code = %Q{+<span id="LC9" class="line"> <span class="k">raise</span> <span class="no"><span class='idiff left'>RuntimeError</span></span><span class="p"><span class='idiff'>,</span></span><span class='idiff right'> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n}
   
expect(subject[5].text).to eq(code) expect(subject[5].text).to eq(code)
end end
Loading
@@ -53,21 +53,21 @@ describe Gitlab::Diff::Highlight, lib: true do
Loading
@@ -53,21 +53,21 @@ describe Gitlab::Diff::Highlight, lib: true do
end end
   
it 'marks unchanged lines' do it 'marks unchanged lines' do
code = %{ def popen(cmd, path=nil)} code = %q{ def popen(cmd, path=nil)}
   
expect(subject[2].text).to eq(code) expect(subject[2].text).to eq(code)
expect(subject[2].text).not_to be_html_safe expect(subject[2].text).not_to be_html_safe
end end
   
it 'marks removed lines' do it 'marks removed lines' do
code = %{- raise "System commands must be given as an array of strings"} code = %q{- raise "System commands must be given as an array of strings"}
   
expect(subject[4].text).to eq(code) expect(subject[4].text).to eq(code)
expect(subject[4].text).not_to be_html_safe expect(subject[4].text).not_to be_html_safe
end end
   
it 'marks added lines' do it 'marks added lines' do
code = %{+ raise <span class='idiff left right'>RuntimeError, </span>&quot;System commands must be given as an array of strings&quot;} code = %q{+ raise <span class='idiff left right'>RuntimeError, </span>&quot;System commands must be given as an array of strings&quot;}
   
expect(subject[5].text).to eq(code) expect(subject[5].text).to eq(code)
expect(subject[5].text).to be_html_safe expect(subject[5].text).to be_html_safe
Loading
Loading
Loading
@@ -68,12 +68,12 @@ describe Gitlab::Gfm::ReferenceRewriter do
Loading
@@ -68,12 +68,12 @@ describe Gitlab::Gfm::ReferenceRewriter do
   
context 'label referenced by id' do context 'label referenced by id' do
let(:text) { '#1 and ~123' } let(:text) { '#1 and ~123' }
it { is_expected.to eq %{#{project_ref}#1 and #{project_ref}~123} } it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~123} }
end end
   
context 'label referenced by text' do context 'label referenced by text' do
let(:text) { '#1 and ~"test"' } let(:text) { '#1 and ~"test"' }
it { is_expected.to eq %{#{project_ref}#1 and #{project_ref}~123} } it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~123} }
end end
end end
   
Loading
@@ -88,12 +88,12 @@ describe Gitlab::Gfm::ReferenceRewriter do
Loading
@@ -88,12 +88,12 @@ describe Gitlab::Gfm::ReferenceRewriter do
   
context 'label referenced by id' do context 'label referenced by id' do
let(:text) { '#1 and ~321' } let(:text) { '#1 and ~321' }
it { is_expected.to eq %{#{project_ref}#1 and #{project_ref}~321} } it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~321} }
end end
   
context 'label referenced by text' do context 'label referenced by text' do
let(:text) { '#1 and ~"group label"' } let(:text) { '#1 and ~"group label"' }
it { is_expected.to eq %{#{project_ref}#1 and #{project_ref}~321} } it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~321} }
end end
end end
end end
Loading
Loading
Loading
@@ -13,9 +13,9 @@ describe Gitlab::Highlight, lib: true do
Loading
@@ -13,9 +13,9 @@ describe Gitlab::Highlight, lib: true do
end end
   
it 'highlights all the lines properly' do it 'highlights all the lines properly' do
expect(lines[4]).to eq(%{<span id="LC5" class="line"> <span class="kp">extend</span> <span class="nb">self</span></span>\n}) expect(lines[4]).to eq(%Q{<span id="LC5" class="line"> <span class="kp">extend</span> <span class="nb">self</span></span>\n})
expect(lines[21]).to eq(%{<span id="LC22" class="line"> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">directory?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></span>\n}) expect(lines[21]).to eq(%Q{<span id="LC22" class="line"> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">directory?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></span>\n})
expect(lines[26]).to eq(%{<span id="LC27" class="line"> <span class="vi">@cmd_status</span> <span class="o">=</span> <span class="mi">0</span></span>\n}) expect(lines[26]).to eq(%Q{<span id="LC27" class="line"> <span class="vi">@cmd_status</span> <span class="o">=</span> <span class="mi">0</span></span>\n})
end end
   
describe 'with CRLF' do describe 'with CRLF' do
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe Gitlab::ReferenceExtractor, lib: true do
Loading
@@ -29,7 +29,7 @@ describe Gitlab::ReferenceExtractor, lib: true do
project.team << [@u_foo, :reporter] project.team << [@u_foo, :reporter]
project.team << [@u_bar, :guest] project.team << [@u_bar, :guest]
   
subject.analyze(%{ subject.analyze(%Q{
Inline code: `@foo` Inline code: `@foo`
   
Code block: Code block:
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe Gitlab::UrlSanitizer, lib: true do
Loading
@@ -9,7 +9,7 @@ describe Gitlab::UrlSanitizer, lib: true do
describe '.sanitize' do describe '.sanitize' do
def sanitize_url(url) def sanitize_url(url)
# We want to try with multi-line content because is how error messages are formatted # We want to try with multi-line content because is how error messages are formatted
described_class.sanitize(%{ described_class.sanitize(%Q{
remote: Not Found remote: Not Found
fatal: repository '#{url}' not found fatal: repository '#{url}' not found
}) })
Loading
Loading
Loading
@@ -105,14 +105,14 @@ describe ProjectLabel, models: true do
Loading
@@ -105,14 +105,14 @@ describe ProjectLabel, models: true do
context 'using name' do context 'using name' do
it 'returns cross reference with label name' do it 'returns cross reference with label name' do
expect(label.to_reference(project, format: :name)) expect(label.to_reference(project, format: :name))
.to eq %(#{label.project.path_with_namespace}~"#{label.name}") .to eq %Q(#{label.project.path_with_namespace}~"#{label.name}")
end end
end end
   
context 'using id' do context 'using id' do
it 'returns cross reference with label id' do it 'returns cross reference with label id' do
expect(label.to_reference(project, format: :id)) expect(label.to_reference(project, format: :id))
.to eq %(#{label.project.path_with_namespace}~#{label.id}) .to eq %Q(#{label.project.path_with_namespace}~#{label.id})
end end
end end
end end
Loading
Loading
Loading
@@ -181,7 +181,7 @@ describe BambooService, models: true, caching: true do
Loading
@@ -181,7 +181,7 @@ describe BambooService, models: true, caching: true do
end end
   
it 'sets commit status to "pending" when response has no results' do it 'sets commit status to "pending" when response has no results' do
stub_request(body: %({"results":{"results":{"size":"0"}}})) stub_request(body: %q({"results":{"results":{"size":"0"}}}))
   
is_expected.to eq('pending') is_expected.to eq('pending')
end end
Loading
@@ -223,6 +223,6 @@ describe BambooService, models: true, caching: true do
Loading
@@ -223,6 +223,6 @@ describe BambooService, models: true, caching: true do
end end
   
def bamboo_response(result_key: 42, build_state: 'success', size: 1) def bamboo_response(result_key: 42, build_state: 'success', size: 1)
%({"results":{"results":{"size":"#{size}","result":{"buildState":"#{build_state}","planResultKey":{"key":"#{result_key}"}}}}}) %Q({"results":{"results":{"size":"#{size}","result":{"buildState":"#{build_state}","planResultKey":{"key":"#{result_key}"}}}}})
end end
end end
Loading
@@ -92,7 +92,7 @@ describe BuildkiteService, models: true, caching: true do
Loading
@@ -92,7 +92,7 @@ describe BuildkiteService, models: true, caching: true do
end end
   
it 'passes through build status untouched when status is 200' do it 'passes through build status untouched when status is 200' do
stub_request(body: %({"status":"Great Success"})) stub_request(body: %q({"status":"Great Success"}))
   
is_expected.to eq('Great Success') is_expected.to eq('Great Success')
end end
Loading
@@ -101,7 +101,7 @@ describe BuildkiteService, models: true, caching: true do
Loading
@@ -101,7 +101,7 @@ describe BuildkiteService, models: true, caching: true do
end end
   
def stub_request(status: 200, body: nil) def stub_request(status: 200, body: nil)
body ||= %({"status":"success"}) body ||= %q({"status":"success"})
buildkite_full_url = 'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=123' buildkite_full_url = 'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=123'
   
WebMock.stub_request(:get, buildkite_full_url).to_return( WebMock.stub_request(:get, buildkite_full_url).to_return(
Loading
Loading
Loading
@@ -50,7 +50,7 @@ describe DroneCiService, models: true, caching: true do
Loading
@@ -50,7 +50,7 @@ describe DroneCiService, models: true, caching: true do
end end
   
def stub_request(status: 200, body: nil) def stub_request(status: 200, body: nil)
body ||= %({"status":"success"}) body ||= %q({"status":"success"})
   
WebMock.stub_request(:get, commit_status_path).to_return( WebMock.stub_request(:get, commit_status_path).to_return(
status: status, status: status,
Loading
@@ -102,7 +102,7 @@ describe DroneCiService, models: true, caching: true do
Loading
@@ -102,7 +102,7 @@ describe DroneCiService, models: true, caching: true do
"success" => "success" "success" => "success"
}.each do |drone_status, our_status| }.each do |drone_status, our_status|
it "sets commit status to #{our_status.inspect} when returned status is #{drone_status.inspect}" do it "sets commit status to #{our_status.inspect} when returned status is #{drone_status.inspect}" do
stub_request(body: %({"status":"#{drone_status}"})) stub_request(body: %Q({"status":"#{drone_status}"}))
   
is_expected.to eq(our_status) is_expected.to eq(our_status)
end end
Loading
Loading
Loading
@@ -143,7 +143,7 @@ describe TeamcityService, models: true, caching: true do
Loading
@@ -143,7 +143,7 @@ describe TeamcityService, models: true, caching: true do
end end
   
it 'returns a build URL when teamcity_url has no trailing slash' do it 'returns a build URL when teamcity_url has no trailing slash' do
stub_request(body: %({"build":{"id":"666"}})) stub_request(body: %q({"build":{"id":"666"}}))
   
is_expected.to eq('http://gitlab.com/teamcity/viewLog.html?buildId=666&buildTypeId=foo') is_expected.to eq('http://gitlab.com/teamcity/viewLog.html?buildId=666&buildTypeId=foo')
end end
Loading
@@ -152,7 +152,7 @@ describe TeamcityService, models: true, caching: true do
Loading
@@ -152,7 +152,7 @@ describe TeamcityService, models: true, caching: true do
let(:teamcity_url) { 'http://gitlab.com/teamcity/' } let(:teamcity_url) { 'http://gitlab.com/teamcity/' }
   
it 'returns a build URL' do it 'returns a build URL' do
stub_request(body: %({"build":{"id":"666"}})) stub_request(body: %q({"build":{"id":"666"}}))
   
is_expected.to eq('http://gitlab.com/teamcity/viewLog.html?buildId=666&buildTypeId=foo') is_expected.to eq('http://gitlab.com/teamcity/viewLog.html?buildId=666&buildTypeId=foo')
end end
Loading
@@ -202,7 +202,7 @@ describe TeamcityService, models: true, caching: true do
Loading
@@ -202,7 +202,7 @@ describe TeamcityService, models: true, caching: true do
   
def stub_request(status: 200, body: nil, build_status: 'success') def stub_request(status: 200, body: nil, build_status: 'success')
teamcity_full_url = 'http://mic:password@gitlab.com/teamcity/httpAuth/app/rest/builds/branch:unspecified:any,number:123' teamcity_full_url = 'http://mic:password@gitlab.com/teamcity/httpAuth/app/rest/builds/branch:unspecified:any,number:123'
body ||= %({"build":{"status":"#{build_status}","id":"666"}}) body ||= %Q({"build":{"status":"#{build_status}","id":"666"}})
   
WebMock.stub_request(:get, teamcity_full_url).to_return( WebMock.stub_request(:get, teamcity_full_url).to_return(
status: status, status: status,
Loading
Loading
Loading
@@ -20,7 +20,7 @@ describe RepositoryImportWorker do
Loading
@@ -20,7 +20,7 @@ describe RepositoryImportWorker do
   
context 'when the import has failed' do context 'when the import has failed' do
it 'hide the credentials that were used in the import URL' do it 'hide the credentials that were used in the import URL' do
error = %{remote: Not Found fatal: repository 'https://user:pass@test.com/root/repoC.git/' not found } error = %q{remote: Not Found fatal: repository 'https://user:pass@test.com/root/repoC.git/' not found }
expect_any_instance_of(Projects::ImportService).to receive(:execute) expect_any_instance_of(Projects::ImportService).to receive(:execute)
.and_return({ status: :error, message: error }) .and_return({ status: :error, message: error })
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment