Commit 61cc6a92 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Rubocop: indentation fixes Yay!!!

parent d0434437
...@@ -283,12 +283,12 @@ Style/IfWithSemicolon: ...@@ -283,12 +283,12 @@ Style/IfWithSemicolon:
Style/IndentationConsistency: Style/IndentationConsistency:
Description: 'Keep indentation straight.' Description: 'Keep indentation straight.'
Enabled: false Enabled: true
Style/IndentationWidth: Style/IndentationWidth:
Description: 'Use 2 spaces for indentation.' Description: 'Use 2 spaces for indentation.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
Enabled: false Enabled: true
Style/IndentArray: Style/IndentArray:
Description: >- Description: >-
......
...@@ -16,16 +16,16 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -16,16 +16,16 @@ class Projects::WikisController < Projects::ApplicationController
if @page if @page
render 'show' render 'show'
elsif file = @project_wiki.find_file(params[:id], params[:version_id]) elsif file = @project_wiki.find_file(params[:id], params[:version_id])
if file.on_disk? if file.on_disk?
send_file file.on_disk_path, disposition: 'inline' send_file file.on_disk_path, disposition: 'inline'
else else
send_data( send_data(
file.raw_data, file.raw_data,
type: file.mime_type, type: file.mime_type,
disposition: 'inline', disposition: 'inline',
filename: file.name filename: file.name
) )
end end
else else
return render('empty') unless can?(current_user, :write_wiki, @project) return render('empty') unless can?(current_user, :write_wiki, @project)
@page = WikiPage.new(@project_wiki) @page = WikiPage.new(@project_wiki)
......
...@@ -40,7 +40,7 @@ class SnippetsFinder ...@@ -40,7 +40,7 @@ class SnippetsFinder
when 'are_public' then when 'are_public' then
snippets.are_public snippets.are_public
else else
snippets snippets
end end
else else
snippets.public_and_internal snippets.public_and_internal
......
...@@ -78,7 +78,7 @@ module ApplicationHelper ...@@ -78,7 +78,7 @@ module ApplicationHelper
style = "background-color: ##{ allowed_colors.values[bg_key] }; color: #555" style = "background-color: ##{ allowed_colors.values[bg_key] }; color: #555"
content_tag(:div, class: options[:class], style: style) do content_tag(:div, class: options[:class], style: style) do
project.name[0, 1].upcase project.name[0, 1].upcase
end end
end end
......
...@@ -90,7 +90,7 @@ module TabHelper ...@@ -90,7 +90,7 @@ module TabHelper
return "active" if current_page?(controller: "/projects", action: :edit, id: @project) return "active" if current_page?(controller: "/projects", action: :edit, id: @project)
if ['services', 'hooks', 'deploy_keys', 'team_members', 'protected_branches'].include? controller.controller_name if ['services', 'hooks', 'deploy_keys', 'team_members', 'protected_branches'].include? controller.controller_name
"active" "active"
end end
end end
......
...@@ -69,12 +69,12 @@ module ActsAsTaggableOn::Taggable ...@@ -69,12 +69,12 @@ module ActsAsTaggableOn::Taggable
select_clause = "DISTINCT #{table_name}.*" unless context and tag_types.one? select_clause = "DISTINCT #{table_name}.*" unless context and tag_types.one?
if owned_by if owned_by
tagging_join << " AND " + tagging_join << " AND " +
sanitize_sql([ sanitize_sql([
"#{taggings_alias}.tagger_id = ? AND #{taggings_alias}.tagger_type = ?", "#{taggings_alias}.tagger_id = ? AND #{taggings_alias}.tagger_type = ?",
owned_by.id, owned_by.id,
owned_by.class.base_class.to_s owned_by.class.base_class.to_s
]) ])
end end
joins << tagging_join joins << tagging_join
...@@ -93,12 +93,12 @@ module ActsAsTaggableOn::Taggable ...@@ -93,12 +93,12 @@ module ActsAsTaggableOn::Taggable
tagging_join << " AND " + sanitize_sql(["#{taggings_alias}.context = ?", context.to_s]) if context tagging_join << " AND " + sanitize_sql(["#{taggings_alias}.context = ?", context.to_s]) if context
if owned_by if owned_by
tagging_join << " AND " + tagging_join << " AND " +
sanitize_sql([ sanitize_sql([
"#{taggings_alias}.tagger_id = ? AND #{taggings_alias}.tagger_type = ?", "#{taggings_alias}.tagger_id = ? AND #{taggings_alias}.tagger_type = ?",
owned_by.id, owned_by.id,
owned_by.class.base_class.to_s owned_by.class.base_class.to_s
]) ])
end end
joins << tagging_join joins << tagging_join
......
...@@ -74,7 +74,7 @@ module Gitlab ...@@ -74,7 +74,7 @@ module Gitlab
def html_escape(str) def html_escape(str)
replacements = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' } replacements = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
str.gsub(/[&"'><]/, replacements) str.gsub(/[&"'><]/, replacements)
end end
end end
end end
......
...@@ -112,14 +112,14 @@ module Gitlab ...@@ -112,14 +112,14 @@ module Gitlab
def protected_branch_action(project, oldrev, newrev, branch_name) def protected_branch_action(project, oldrev, newrev, branch_name)
# we dont allow force push to protected branch # we dont allow force push to protected branch
if forced_push?(project, oldrev, newrev) if forced_push?(project, oldrev, newrev)
:force_push_code_to_protected_branches :force_push_code_to_protected_branches
elsif newrev == Gitlab::Git::BLANK_SHA elsif newrev == Gitlab::Git::BLANK_SHA
# and we dont allow remove of protected branch # and we dont allow remove of protected branch
:remove_protected_branches :remove_protected_branches
elsif project.developers_can_push_to_protected_branch?(branch_name) elsif project.developers_can_push_to_protected_branch?(branch_name)
:push_code :push_code
else else
:push_code_to_protected_branches :push_code_to_protected_branches
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