summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-30 14:51:42 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-30 14:51:42 +0200
commitfdcb7e36859ed6cf2ce5cb1117391d791213e80e (patch)
treea3f13895b14d889e07ce9dd1a7e2287f0d6db5ff
parent43c35b0f20fb3bb67ea2b96bf8f806c7e95b6aec (diff)
downloadgitlab-ce-rubocop/enable-space-before-comma-cop.tar.gz
Enable Style/SpaceBeforeComma rubocop coprubocop/enable-space-before-comma-cop
No spaces before commas. See #17478
-rw-r--r--.rubocop.yml2
-rw-r--r--app/models/network/graph.rb13
-rw-r--r--config/routes.rb8
3 files changed, 17 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 2d8eb4077f3..27c69ffab2b 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -570,7 +570,7 @@ Style/SpaceBeforeBlockBraces:
# No spaces before commas.
Style/SpaceBeforeComma:
- Enabled: false
+ Enabled: true
# Checks for missing space between code and a comment on the same line.
Style/SpaceBeforeComment:
diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb
index 9259cb1a0fa..dd66d681c09 100644
--- a/app/models/network/graph.rb
+++ b/app/models/network/graph.rb
@@ -22,9 +22,16 @@ module Network
def collect_notes
h = Hash.new(0)
- @project.notes.where('noteable_type = ?' ,"Commit").group('notes.commit_id').select('notes.commit_id, count(notes.id) as note_count').each do |item|
- h[item.commit_id] = item.note_count.to_i
- end
+
+ @project
+ .notes
+ .where('noteable_type = ?', 'Commit')
+ .group('notes.commit_id')
+ .select('notes.commit_id, count(notes.id) as note_count')
+ .each do |item|
+ h[item.commit_id] = item.note_count.to_i
+ end
+
h
end
diff --git a/config/routes.rb b/config/routes.rb
index 9a5d0074a0a..428302d0fd7 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -421,7 +421,11 @@ Rails.application.routes.draw do
resources :projects, constraints: { id: /[^\/]+/ }, only: [:index, :new, :create]
- devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations }
+ devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks,
+ registrations: :registrations,
+ passwords: :passwords,
+ sessions: :sessions,
+ confirmations: :confirmations }
devise_scope :user do
get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
@@ -789,7 +793,7 @@ Rails.application.routes.draw do
end
# Get all keys of user
- get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }
+ get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }
get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
end