Commit 18ac02a3 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rs-space-around-keyword' into 'master'

Enable Style/SpaceAroundKeyword cop and fix offenses

Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17478

See merge request !4259
parents 206e8344 3ba72f69
...@@ -543,10 +543,9 @@ Style/SpaceAfterSemicolon: ...@@ -543,10 +543,9 @@ Style/SpaceAfterSemicolon:
Style/SpaceAroundEqualsInParameterDefault: Style/SpaceAroundEqualsInParameterDefault:
Enabled: false Enabled: false
# TODO: Enable SpaceAroundKeyword Cop.
# Use a space around keywords if appropriate. # Use a space around keywords if appropriate.
Style/SpaceAroundKeyword: Style/SpaceAroundKeyword:
Enabled: false Enabled: true
# Use a single space around operators. # Use a single space around operators.
Style/SpaceAroundOperators: Style/SpaceAroundOperators:
......
...@@ -110,8 +110,7 @@ module ApplicationHelper ...@@ -110,8 +110,7 @@ module ApplicationHelper
] ]
# If reference is commit id - we should add it to branch/tag selectbox # If reference is commit id - we should add it to branch/tag selectbox
if(@ref && !options.flatten.include?(@ref) && if @ref && !options.flatten.include?(@ref) && @ref =~ /\A[0-9a-zA-Z]{6,52}\z/
@ref =~ /\A[0-9a-zA-Z]{6,52}\z/)
options << ['Commit', [@ref]] options << ['Commit', [@ref]]
end end
......
...@@ -98,7 +98,7 @@ module Ci ...@@ -98,7 +98,7 @@ module Ci
open_new_tag open_new_tag
s = StringScanner.new(ansi) s = StringScanner.new(ansi)
while(!s.eos?) until s.eos?
if s.scan(/\e([@-_])(.*?)([@-~])/) if s.scan(/\e([@-_])(.*?)([@-~])/)
handle_sequence(s) handle_sequence(s)
elsif s.scan(/\e(([@-_])(.*?)?)?$/) elsif s.scan(/\e(([@-_])(.*?)?)?$/)
......
...@@ -28,7 +28,7 @@ describe Projects::GroupLinksController do ...@@ -28,7 +28,7 @@ describe Projects::GroupLinksController do
expect(group.shared_projects).to include project expect(group.shared_projects).to include project
end end
it 'redirects to project group links page'do it 'redirects to project group links page' do
expect(response).to redirect_to( expect(response).to redirect_to(
namespace_project_group_links_path(project.namespace, project) namespace_project_group_links_path(project.namespace, project)
) )
......
...@@ -5,7 +5,7 @@ describe 'factories' do ...@@ -5,7 +5,7 @@ describe 'factories' do
describe "#{factory.name} factory" do describe "#{factory.name} factory" do
let(:entity) { build(factory.name) } let(:entity) { build(factory.name) }
it 'does not raise error when created 'do it 'does not raise error when created' do
expect { entity }.to_not raise_error expect { entity }.to_not raise_error
end end
......
...@@ -49,7 +49,7 @@ describe ApplicationSetting, 'TokenAuthenticatable' do ...@@ -49,7 +49,7 @@ describe ApplicationSetting, 'TokenAuthenticatable' do
context 'token is generated' do context 'token is generated' do
before { subject.send("reset_#{token_field}!") } before { subject.send("reset_#{token_field}!") }
it 'persists a new token 'do it 'persists a new token' do
expect(subject.send(:read_attribute, token_field)).to be_a String expect(subject.send(:read_attribute, token_field)).to be_a String
end end
end end
......
...@@ -54,7 +54,7 @@ describe Issues::CreateService, services: true do ...@@ -54,7 +54,7 @@ describe Issues::CreateService, services: true do
label_ids: [label.id] } label_ids: [label.id] }
end end
it 'does not assign label'do it 'does not assign label' do
expect(issue.labels).to_not include label expect(issue.labels).to_not include label
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment