Skip to content
Snippets Groups Projects
Commit d40e1f54 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Enable the Style/TrailingCommaInLiteral cop


Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 566ee145
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 26 deletions
Loading
Loading
@@ -494,7 +494,8 @@ Style/TrailingBlankLines:
 
# This cop checks for trailing comma in array and hash literals.
Style/TrailingCommaInLiteral:
Enabled: false
Enabled: true
EnforcedStyleForMultiline: no_comma
 
# Checks for %W when interpolation is not needed.
Style/UnneededCapitalW:
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ class AutocompleteController < ApplicationController
 
no_project = {
id: 0,
name_with_namespace: 'No project',
name_with_namespace: 'No project'
}
projects.unshift(no_project) unless params[:offset_id].present?
 
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ module LfsRequest
render(
json: {
message: 'Git LFS is not enabled on this GitLab server, contact your admin.',
documentation_url: help_url,
documentation_url: help_url
},
status: 501
)
Loading
Loading
@@ -48,7 +48,7 @@ module LfsRequest
render(
json: {
message: 'Access forbidden. Check your access level.',
documentation_url: help_url,
documentation_url: help_url
},
content_type: "application/vnd.git-lfs+json",
status: 403
Loading
Loading
@@ -59,7 +59,7 @@ module LfsRequest
render(
json: {
message: 'Not found.',
documentation_url: help_url,
documentation_url: help_url
},
content_type: "application/vnd.git-lfs+json",
status: 404
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class HealthController < ActionController::Base
CHECKS = [
Gitlab::HealthChecks::DbCheck,
Gitlab::HealthChecks::RedisCheck,
Gitlab::HealthChecks::FsShardsCheck,
Gitlab::HealthChecks::FsShardsCheck
].freeze
 
def readiness
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ class JwtController < ApplicationController
before_action :authenticate_project_or_user
 
SERVICES = {
Auth::ContainerRegistryAuthenticationService::AUDIENCE => Auth::ContainerRegistryAuthenticationService,
Auth::ContainerRegistryAuthenticationService::AUDIENCE => Auth::ContainerRegistryAuthenticationService
}.freeze
 
def auth
Loading
Loading
Loading
Loading
@@ -209,7 +209,7 @@ class Projects::IssuesController < Projects::ApplicationController
description_text: @issue.description,
task_status: @issue.task_status,
issue_number: @issue.iid,
updated_at: @issue.updated_at,
updated_at: @issue.updated_at
}
end
 
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController
render(
json: {
message: 'Server supports batch API only, please update your Git LFS client to version 1.0.1 and up.',
documentation_url: "#{Gitlab.config.gitlab.url}/help",
documentation_url: "#{Gitlab.config.gitlab.url}/help"
},
status: 501
)
Loading
Loading
@@ -55,7 +55,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController
else
object[:error] = {
code: 404,
message: "Object does not exist on the server or you don't have permissions to access it",
message: "Object does not exist on the server or you don't have permissions to access it"
}
end
end
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ class Projects::PipelinesController < Projects::ApplicationController
all: @pipelines_count,
running: @running_count,
pending: @pending_count,
finished: @finished_count,
finished: @finished_count
}
}
end
Loading
Loading
Loading
Loading
@@ -48,7 +48,7 @@ class Projects::TreeController < Projects::ApplicationController
@dir_name = File.join(@path, params[:dir_name])
@commit_params = {
file_path: @dir_name,
commit_message: params[:commit_message],
commit_message: params[:commit_message]
}
end
end
Loading
Loading
@@ -220,7 +220,7 @@ class ProjectsController < Projects::ApplicationController
branches = BranchesFinder.new(@repository, params).execute.map(&:name)
 
options = {
'Branches' => branches.take(100),
'Branches' => branches.take(100)
}
 
unless @repository.tag_count.zero?
Loading
Loading
Loading
Loading
@@ -98,7 +98,7 @@ module DiffHelper
[
content_tag(:span, link_to(truncate(blob.name, length: 40), tree)),
'@',
content_tag(:span, commit_id, class: 'monospace'),
content_tag(:span, commit_id, class: 'monospace')
].join(' ').html_safe
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ module EmailsHelper
"action" => {
"@type" => "ViewAction",
"name" => name,
"url" => url,
"url" => url
}
}
 
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ module EventsHelper
link_opts = {
class: "event-filter-link",
id: "#{key}_event_filter",
title: "Filter by #{tooltip.downcase}",
title: "Filter by #{tooltip.downcase}"
}
 
content_tag :li, class: active do
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ module ExploreHelper
personal: params[:personal],
archived: params[:archived],
shared: params[:shared],
namespace_id: params[:namespace_id],
namespace_id: params[:namespace_id]
}
 
options = exist_opts.merge(options).delete_if { |key, value| value.blank? }
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ module MarkupHelper
context = {
project: @project,
current_user: (current_user if defined?(current_user)),
pipeline: :single_line,
pipeline: :single_line
}
gfm_body = Banzai.render(body, context)
 
Loading
Loading
Loading
Loading
@@ -54,7 +54,7 @@ module MergeRequestsHelper
source_project_id: merge_request.source_project_id,
target_project_id: merge_request.target_project_id,
source_branch: merge_request.source_branch,
target_branch: merge_request.target_branch,
target_branch: merge_request.target_branch
},
change_branches: true
)
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ module NotesHelper
id: noteable.id,
class: noteable.class.name,
resources: noteable.class.table_name,
project_id: noteable.project.id,
project_id: noteable.project.id
}.to_json
end
 
Loading
Loading
@@ -34,7 +34,7 @@ module NotesHelper
 
data = {
line_code: line_code,
line_type: line_type,
line_type: line_type
}
 
if @use_legacy_diff_notes
Loading
Loading
Loading
Loading
@@ -42,7 +42,7 @@ module SearchHelper
{ category: "Settings", label: "User settings", url: profile_path },
{ category: "Settings", label: "SSH Keys", url: profile_keys_path },
{ category: "Settings", label: "Dashboard", url: root_path },
{ category: "Settings", label: "Admin Section", url: admin_root_path },
{ category: "Settings", label: "Admin Section", url: admin_root_path }
]
end
 
Loading
Loading
@@ -57,7 +57,7 @@ module SearchHelper
{ category: "Help", label: "SSH Keys Help", url: help_page_path("ssh/README") },
{ category: "Help", label: "System Hooks Help", url: help_page_path("system_hooks/system_hooks") },
{ category: "Help", label: "Webhooks Help", url: help_page_path("user/project/integrations/webhooks") },
{ category: "Help", label: "Workflow Help", url: help_page_path("workflow/README") },
{ category: "Help", label: "Workflow Help", url: help_page_path("workflow/README") }
]
end
 
Loading
Loading
@@ -76,7 +76,7 @@ module SearchHelper
{ category: "Current Project", label: "Milestones", url: namespace_project_milestones_path(@project.namespace, @project) },
{ category: "Current Project", label: "Snippets", url: namespace_project_snippets_path(@project.namespace, @project) },
{ category: "Current Project", label: "Members", url: namespace_project_settings_members_path(@project.namespace, @project) },
{ category: "Current Project", label: "Wiki", url: namespace_project_wikis_path(@project.namespace, @project) },
{ category: "Current Project", label: "Wiki", url: namespace_project_wikis_path(@project.namespace, @project) }
]
else
[]
Loading
Loading
Loading
Loading
@@ -67,7 +67,7 @@ module SelectsHelper
current_user: opts[:current_user] || false,
"push-code-to-protected-branches" => opts[:push_code_to_protected_branches],
author_id: opts[:author_id] || '',
skip_users: opts[:skip_users] ? opts[:skip_users].map(&:id) : nil,
skip_users: opts[:skip_users] ? opts[:skip_users].map(&:id) : nil
}
end
end
Loading
Loading
@@ -58,7 +58,7 @@ module SortingHelper
sort_value_due_date_soon => sort_title_due_date_soon,
sort_value_due_date_later => sort_title_due_date_later,
sort_value_start_date_soon => sort_title_start_date_soon,
sort_value_start_date_later => sort_title_start_date_later,
sort_value_start_date_later => sort_title_start_date_later
}
end
 
Loading
Loading
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