Skip to content
Snippets Groups Projects
Commit 443d5842 authored by Robert Speicher's avatar Robert Speicher
Browse files

Merge branch 'rubocop/enable-unneeded-capital-w-cop' into 'master'

Enable Style/UnneededCapitalW Rubocop cop

## What does this MR do?

This MR enables Rubocop cop that checks if `%W[]`, which supports interpolation, is needed.

## What are the relevant issue numbers?

#17478 

See merge request !5010
parents 73196fbd efd70c18
No related branches found
No related tags found
1 merge request!5010Enable Style/UnneededCapitalW Rubocop cop
Pipeline #
Loading
@@ -681,7 +681,7 @@ Style/UnlessElse:
Loading
@@ -681,7 +681,7 @@ Style/UnlessElse:
   
# Checks for %W when interpolation is not needed. # Checks for %W when interpolation is not needed.
Style/UnneededCapitalW: Style/UnneededCapitalW:
Enabled: false Enabled: true
   
# TODO: Enable UnneededInterpolation Cop. # TODO: Enable UnneededInterpolation Cop.
# Checks for strings that are just an interpolated expression. # Checks for strings that are just an interpolated expression.
Loading
Loading
Loading
@@ -39,7 +39,7 @@ module Gitlab
Loading
@@ -39,7 +39,7 @@ module Gitlab
# OpenSSH 6.8 introduces a new default output format for fingerprints. # OpenSSH 6.8 introduces a new default output format for fingerprints.
# Check the version and decide which command to use. # Check the version and decide which command to use.
   
version_output, version_status = popen(%W(ssh -V)) version_output, version_status = popen(%w(ssh -V))
return false unless version_status.zero? return false unless version_status.zero?
   
version_matches = version_output.match(/OpenSSH_(?<major>\d+)\.(?<minor>\d+)/) version_matches = version_output.match(/OpenSSH_(?<major>\d+)\.(?<minor>\d+)/)
Loading
Loading
Loading
@@ -10,7 +10,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
Loading
@@ -10,7 +10,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
   
context 'zero status' do context 'zero status' do
before do before do
@output, @status = @klass.new.popen(%W(ls), path) @output, @status = @klass.new.popen(%w(ls), path)
end end
   
it { expect(@status).to be_zero } it { expect(@status).to be_zero }
Loading
@@ -19,7 +19,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
Loading
@@ -19,7 +19,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
   
context 'non-zero status' do context 'non-zero status' do
before do before do
@output, @status = @klass.new.popen(%W(cat NOTHING), path) @output, @status = @klass.new.popen(%w(cat NOTHING), path)
end end
   
it { expect(@status).to eq(1) } it { expect(@status).to eq(1) }
Loading
@@ -34,7 +34,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
Loading
@@ -34,7 +34,7 @@ describe 'Gitlab::Popen', lib: true, no_db: true do
   
context 'without a directory argument' do context 'without a directory argument' do
before do before do
@output, @status = @klass.new.popen(%W(ls)) @output, @status = @klass.new.popen(%w(ls))
end end
   
it { expect(@status).to be_zero } it { expect(@status).to be_zero }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment