Enable Style/SpaceAroundKeyword cop and fix offenses

This commit is contained in:
Robert Speicher 2016-05-23 14:16:35 -04:00
parent 68b8e86a81
commit 3ba72f69af
7 changed files with 7 additions and 9 deletions

View file

@ -525,10 +525,9 @@ Style/SpaceAfterSemicolon:
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false
# TODO: Enable SpaceAroundKeyword Cop.
# Use a space around keywords if appropriate.
Style/SpaceAroundKeyword:
Enabled: false
Enabled: true
# Use a single space around operators.
Style/SpaceAroundOperators:

View file

@ -110,8 +110,7 @@ module ApplicationHelper
]
# If reference is commit id - we should add it to branch/tag selectbox
if(@ref && !options.flatten.include?(@ref) &&
@ref =~ /\A[0-9a-zA-Z]{6,52}\z/)
if @ref && !options.flatten.include?(@ref) && @ref =~ /\A[0-9a-zA-Z]{6,52}\z/
options << ['Commit', [@ref]]
end

View file

@ -98,7 +98,7 @@ module Ci
open_new_tag
s = StringScanner.new(ansi)
while(!s.eos?)
until s.eos?
if s.scan(/\e([@-_])(.*?)([@-~])/)
handle_sequence(s)
elsif s.scan(/\e(([@-_])(.*?)?)?$/)

View file

@ -28,7 +28,7 @@ describe Projects::GroupLinksController do
expect(group.shared_projects).to include project
end
it 'redirects to project group links page'do
it 'redirects to project group links page' do
expect(response).to redirect_to(
namespace_project_group_links_path(project.namespace, project)
)

View file

@ -5,7 +5,7 @@ describe 'factories' do
describe "#{factory.name} factory" do
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
end

View file

@ -49,7 +49,7 @@ describe ApplicationSetting, 'TokenAuthenticatable' do
context 'token is generated' do
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
end
end

View file

@ -54,7 +54,7 @@ describe Issues::CreateService, services: true do
label_ids: [label.id] }
end
it 'does not assign label'do
it 'does not assign label' do
expect(issue.labels).to_not include label
end
end