diff options
author | Robert Speicher <robert@gitlab.com> | 2016-05-23 19:29:25 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-05-23 19:29:25 +0000 |
commit | 18ac02a3fec248a1f2bb3ef5aff30344b8f80d40 (patch) | |
tree | 6cc1cff55e05fddaee8d1f08245403eb5454b9c2 | |
parent | 206e8344b882c985ac920c1dc9f2fba0045aafe8 (diff) | |
parent | 3ba72f69af69d9fb2c46cb6c25d571f92ffd2ee1 (diff) | |
download | gitlab-ce-18ac02a3fec248a1f2bb3ef5aff30344b8f80d40.tar.gz |
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
-rw-r--r-- | .rubocop.yml | 3 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 3 | ||||
-rw-r--r-- | lib/ci/ansi2html.rb | 2 | ||||
-rw-r--r-- | spec/controllers/projects/group_links_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/factories_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/concerns/token_authenticatable_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 2 |
7 files changed, 7 insertions, 9 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 5143736658b..a3caba7068f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -543,10 +543,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: diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3e0074da394..e6e2546b92f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/lib/ci/ansi2html.rb b/lib/ci/ansi2html.rb index 5fed43aaebd..c628257e3f4 100644 --- a/lib/ci/ansi2html.rb +++ b/lib/ci/ansi2html.rb @@ -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(([@-_])(.*?)?)?$/) diff --git a/spec/controllers/projects/group_links_controller_spec.rb b/spec/controllers/projects/group_links_controller_spec.rb index 40bd83af861..1bd1fc5189e 100644 --- a/spec/controllers/projects/group_links_controller_spec.rb +++ b/spec/controllers/projects/group_links_controller_spec.rb @@ -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) ) diff --git a/spec/factories_spec.rb b/spec/factories_spec.rb index 62de081661d..a073a1f9d7c 100644 --- a/spec/factories_spec.rb +++ b/spec/factories_spec.rb @@ -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 diff --git a/spec/models/concerns/token_authenticatable_spec.rb b/spec/models/concerns/token_authenticatable_spec.rb index 30c0a04b840..b6adc2bf247 100644 --- a/spec/models/concerns/token_authenticatable_spec.rb +++ b/spec/models/concerns/token_authenticatable_spec.rb @@ -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 diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index ac28b6f71f9..6aa0a89f893 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -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 |