Skip to content
Snippets Groups Projects
Commit e8905826 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Rubocop enabled for: Use spaces inside hash literal braces

parent 84a5a548
No related branches found
No related tags found
1 merge request!8686add "Uplaod" and "Replace" functionality
Showing
with 52 additions and 52 deletions
Loading
Loading
@@ -617,7 +617,7 @@ Style/SpaceInsideBrackets:
Style/SpaceInsideHashLiteralBraces:
Description: "Use spaces inside hash literal braces - or don't."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
Enabled: false
Enabled: true
 
Style/SpaceInsideParens:
Description: 'No spaces after ( or before ).'
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ class SnippetsController < ApplicationController
@snippets = SnippetsFinder.new.execute(current_user, {
filter: :by_user,
user: @user,
scope: params[:scope]}).
scope: params[:scope] }).
page(params[:page]).per(20)
 
if @user == current_user
Loading
Loading
module CompareHelper
def compare_to_mr_button?
@project.merge_requests_enabled &&
params[:from].present? &&
params[:from].present? &&
params[:to].present? &&
@repository.branch_names.include?(params[:from]) &&
@repository.branch_names.include?(params[:to]) &&
Loading
Loading
@@ -10,6 +10,6 @@ module CompareHelper
end
 
def compare_mr_path
new_project_merge_request_path(@project, merge_request: {source_branch: params[:to], target_branch: params[:from]})
new_project_merge_request_path(@project, merge_request: { source_branch: params[:to], target_branch: params[:from] })
end
end
Loading
Loading
@@ -95,7 +95,7 @@ module ProjectsHelper
class: cls,
method: :post,
remote: true,
data: {type: 'json'}
data: { type: 'json' }
}
 
 
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ class WebHook < ActiveRecord::Base
}
WebHook.post(post_url,
body: data.to_json,
headers: {"Content-Type" => "application/json"},
headers: { "Content-Type" => "application/json" },
verify: false,
basic_auth: auth)
end
Loading
Loading
Loading
Loading
@@ -11,5 +11,5 @@
class Identity < ActiveRecord::Base
belongs_to :user
 
validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider}
validates :extern_uid, allow_blank: true, uniqueness: { scope: :provider }
end
Loading
Loading
@@ -41,8 +41,8 @@ class CustomIssueTrackerService < IssueTrackerService
{ type: 'text', name: 'title', placeholder: title },
{ type: 'text', name: 'description', placeholder: description },
{ type: 'text', name: 'project_url', placeholder: 'Project url' },
{ type: 'text', name: 'issues_url', placeholder: 'Issue url'},
{ type: 'text', name: 'new_issue_url', placeholder: 'New Issue url'}
{ type: 'text', name: 'issues_url', placeholder: 'Issue url' },
{ type: 'text', name: 'new_issue_url', placeholder: 'New Issue url' }
]
end
 
Loading
Loading
Loading
Loading
@@ -81,7 +81,7 @@ class GitlabCiService < CiService
def fields
[
{ type: 'text', name: 'token', placeholder: 'GitLab CI project specific token' },
{ type: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3'}
{ type: 'text', name: 'project_url', placeholder: 'http://ci.gitlabhq.com/projects/3' }
]
end
end
Loading
Loading
@@ -44,8 +44,8 @@ class IssueTrackerService < Service
[
{ type: 'text', name: 'description', placeholder: description },
{ type: 'text', name: 'project_url', placeholder: 'Project url' },
{ type: 'text', name: 'issues_url', placeholder: 'Issue url'},
{ type: 'text', name: 'new_issue_url', placeholder: 'New Issue url'}
{ type: 'text', name: 'issues_url', placeholder: 'Issue url' },
{ type: 'text', name: 'new_issue_url', placeholder: 'New Issue url' }
]
end
 
Loading
Loading
Loading
Loading
@@ -136,7 +136,7 @@ class ProjectWiki
def commit_details(action, message = nil, title = nil)
commit_message = message || default_message(action, title)
 
{email: @user.email, name: @user.name, message: commit_message}
{ email: @user.email, name: @user.name, message: commit_message }
end
 
def default_message(action, title)
Loading
Loading
Loading
Loading
@@ -113,9 +113,9 @@ class User < ActiveRecord::Base
# Validations
#
validates :name, presence: true
validates :email, presence: true, email: {strict_mode: true}, uniqueness: true
validates :email, presence: true, email: { strict_mode: true }, uniqueness: true
validates :bio, length: { maximum: 255 }, allow_blank: true
validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0}
validates :projects_limit, presence: true, numericality: { greater_than_or_equal_to: 0 }
validates :username, presence: true, uniqueness: { case_sensitive: false },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.username_regex,
Loading
Loading
Loading
Loading
@@ -148,7 +148,7 @@ Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_s
Settings['backup'] ||= Settingslogic.new({})
Settings.backup['keep_time'] ||= 0
Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root)
Settings.backup['upload'] ||= Settingslogic.new({'remote_directory' => nil, 'connection' => nil})
Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'connection' => nil })
# Convert upload connection settings to use symbol keys, to make Fog happy
if Settings.backup['upload']['connection']
Settings.backup['upload']['connection'] = Hash[Settings.backup['upload']['connection'].map { |k, v| [k.to_sym, v] }]
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ if File.exists?(aws_file)
}
config.fog_directory = AWS_CONFIG['bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
config.fog_attributes = { 'Cache-Control'=>'max-age=315576000' } # optional, defaults to {}
config.fog_authenticated_url_expiration = 1 << 29 # optional time (in seconds) that authenticated urls will be valid.
# when fog_public is false and provider is AWS or Google, defaults to 600
end
Loading
Loading
Loading
Loading
@@ -177,7 +177,7 @@ Gitlab::Application.routes.draw do
#
# Groups Area
#
resources :groups, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} do
resources :groups, constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ } do
member do
get :issues
get :merge_requests
Loading
Loading
@@ -215,40 +215,40 @@ Gitlab::Application.routes.draw do
 
scope module: :projects do
# Blob routes:
get '/new/:id', to: 'blob#new', constraints: {id: /.+/}, as: 'new_blob'
post '/create/:id', to: 'blob#create', constraints: {id: /.+/}, as: 'create_blob'
get '/edit/:id', to: 'blob#edit', constraints: {id: /.+/}, as: 'edit_blob'
put '/update/:id', to: 'blob#update', constraints: {id: /.+/}, as: 'update_blob'
post '/preview/:id', to: 'blob#preview', constraints: {id: /.+/}, as: 'preview_blob'
get '/new/:id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob'
post '/create/:id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob'
get '/edit/:id', to: 'blob#edit', constraints: { id: /.+/ }, as: 'edit_blob'
put '/update/:id', to: 'blob#update', constraints: { id: /.+/ }, as: 'update_blob'
post '/preview/:id', to: 'blob#preview', constraints: { id: /.+/ }, as: 'preview_blob'
 
resources :blob, only: [:show, :destroy], constraints: { id: /.+/, format: false } do
get :diff, on: :member
end
 
resources :raw, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ }
resources :raw, only: [:show], constraints: { id: /.+/ }
resources :tree, only: [:show], constraints: { id: /.+/, format: /(html|js)/ }
resource :avatar, only: [:show, :destroy]
resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ }
resources :commits, only: [:show], constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
resources :network, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} do
resources :blame, only: [:show], constraints: { id: /.+/ }
resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }
resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
member do
get :commits
end
end
 
get '/compare/:from...:to' => 'compare#show', :as => 'compare',
:constraints => {from: /.+/, to: /.+/}
:constraints => { from: /.+/, to: /.+/ }
 
resources :snippets, constraints: {id: /\d+/} do
resources :snippets, constraints: { id: /\d+/ } do
member do
get 'raw'
end
end
 
resources :wikis, only: [:show, :edit, :destroy, :create], constraints: {id: /[a-zA-Z.0-9_\-\/]+/} do
resources :wikis, only: [:show, :edit, :destroy, :create], constraints: { id: /[a-zA-Z.0-9_\-\/]+/ } do
collection do
get :pages
put ':id' => 'wikis#update'
Loading
Loading
@@ -275,7 +275,7 @@ Gitlab::Application.routes.draw do
end
end
 
resources :deploy_keys, constraints: {id: /\d+/} do
resources :deploy_keys, constraints: { id: /\d+/ } do
member do
put :enable
put :disable
Loading
Loading
@@ -303,7 +303,7 @@ Gitlab::Application.routes.draw do
end
end
 
resources :merge_requests, constraints: {id: /\d+/}, except: [:destroy] do
resources :merge_requests, constraints: { id: /\d+/ }, except: [:destroy] do
member do
get :diffs
post :automerge
Loading
Loading
@@ -318,27 +318,27 @@ Gitlab::Application.routes.draw do
end
end
 
resources :hooks, only: [:index, :create, :destroy], constraints: {id: /\d+/} do
resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
member do
get :test
end
end
 
resources :team, controller: 'team_members', only: [:index]
resources :milestones, except: [:destroy], constraints: {id: /\d+/} do
resources :milestones, except: [:destroy], constraints: { id: /\d+/ } do
member do
put :sort_issues
put :sort_merge_requests
end
end
 
resources :labels, constraints: {id: /\d+/} do
resources :labels, constraints: { id: /\d+/ } do
collection do
post :generate
end
end
 
resources :issues, constraints: {id: /\d+/}, except: [:destroy] do
resources :issues, constraints: { id: /\d+/ }, except: [:destroy] do
collection do
post :bulk_update
end
Loading
Loading
@@ -355,7 +355,7 @@ Gitlab::Application.routes.draw do
end
end
 
resources :notes, only: [:index, :create, :destroy, :update], constraints: {id: /\d+/} do
resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do
member do
delete :delete_attachment
end
Loading
Loading
@@ -364,7 +364,7 @@ Gitlab::Application.routes.draw do
end
end
 
get ':id' => 'namespaces#show', constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
 
root to: 'dashboard#show'
end
Loading
Loading
@@ -6,7 +6,7 @@ module API
version 'v3', using: :path
 
rescue_from ActiveRecord::RecordNotFound do
rack_response({'message' => '404 Not found'}.to_json, 404)
rack_response({ 'message' => '404 Not found' }.to_json, 404)
end
 
rescue_from :all do |exception|
Loading
Loading
@@ -19,7 +19,7 @@ module API
message << " " << trace.join("\n ")
 
API.logger.add Logger::FATAL, message
rack_response({'message' => '500 Internal Server Error'}, 500)
rack_response({ 'message' => '500 Internal Server Error' }, 500)
end
 
format :json
Loading
Loading
Loading
Loading
@@ -146,7 +146,7 @@ module APIGuard
Rack::OAuth2::Server::Resource::Bearer::Forbidden.new(
:insufficient_scope,
Rack::OAuth2::Server::Resource::ErrorMethods::DEFAULT_DESCRIPTION[:insufficient_scope],
{ scope: e.scopes})
{ scope: e.scopes })
end
 
response.finish
Loading
Loading
Loading
Loading
@@ -173,7 +173,7 @@ module API
end
 
def render_api_error!(message, status)
error!({'message' => message}, status)
error!({ 'message' => message }, status)
end
 
private
Loading
Loading
Loading
Loading
@@ -106,7 +106,7 @@ module API
unless team_member.nil?
team_member.destroy
else
{message: "Access revoked", id: params[:user_id].to_i}
{ message: "Access revoked", id: params[:user_id].to_i }
end
end
end
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ module Grack
def auth!
if @auth.provided?
return bad_request unless @auth.basic?
# Authentication with username and password
login, password = @auth.credentials
 
Loading
Loading
@@ -80,11 +80,11 @@ module Grack
 
def authenticate_user(login, password)
user = Gitlab::Auth.new.find(login, password)
unless user
user = oauth_access_token_check(login, password)
end
return user if user.present?
 
# At this point, we know the credentials were wrong. We let Rack::Attack
Loading
Loading
@@ -154,7 +154,7 @@ module Grack
end
 
def render_not_found
[404, {"Content-Type" => "text/plain"}, ["Not Found"]]
[404, { "Content-Type" => "text/plain" }, ["Not Found"]]
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ module Gitlab
end
 
def to_json
{status: @status, message: @message}.to_json
{ status: @status, message: @message }.to_json
end
end
end
\ No newline at end of file
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment