Commit cb2f739d authored by Robert Speicher's avatar Robert Speicher

Merge branch '27144-enforce-rubocop-trailing_commas-no_comma-style' into 'master'

Resolve "Use consistent style for trailing commas"

Closes #27144

See merge request !11063
parents 000045e6 3db37e05
......@@ -494,7 +494,13 @@ Style/TrailingBlankLines:
# This cop checks for trailing comma in array and hash literals.
Style/TrailingCommaInLiteral:
Enabled: false
Enabled: true
EnforcedStyleForMultiline: no_comma
# This cop checks for trailing comma in argument lists.
Style/TrailingCommaInArguments:
Enabled: true
EnforcedStyleForMultiline: no_comma
# Checks for %W when interpolation is not needed.
Style/UnneededCapitalW:
......
......@@ -369,13 +369,6 @@ Style/SymbolProc:
Style/TernaryParentheses:
Enabled: false
# Offense count: 53
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Enabled: false
# Offense count: 18
# Cop supports --auto-correct.
# Configuration parameters: AllowNamedUnderscoreVariables.
......
......@@ -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?
......
......@@ -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
)
......@@ -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
......@@ -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
......
......@@ -5,7 +5,7 @@ class HealthController < ActionController::Base
CHECKS = [
Gitlab::HealthChecks::DbCheck,
Gitlab::HealthChecks::RedisCheck,
Gitlab::HealthChecks::FsShardsCheck,
Gitlab::HealthChecks::FsShardsCheck
].freeze
def readiness
......
......@@ -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
......
......@@ -33,7 +33,7 @@ class Profiles::PreferencesController < Profiles::ApplicationController
:color_scheme_id,
:layout,
:dashboard,
:project_view,
:project_view
)
end
end
......@@ -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
......@@ -269,7 +269,7 @@ class Projects::IssuesController < Projects::ApplicationController
def issue_params
params.require(:issue).permit(
:title, :assignee_id, :position, :description, :confidential,
:milestone_id, :due_date, :state_event, :task_num, :lock_version, label_ids: [], assignee_ids: [],
:milestone_id, :due_date, :state_event, :task_num, :lock_version, label_ids: [], assignee_ids: []
)
end
......
......@@ -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
)
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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?
......
......@@ -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
......
......@@ -12,7 +12,7 @@ module EmailsHelper
"action" => {
"@type" => "ViewAction",
"name" => name,
"url" => url,
"url" => url
}
}
......
......@@ -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
......
......@@ -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? }
......
......@@ -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)
......
......@@ -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
)
......
......@@ -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
......@@ -34,7 +34,7 @@ module NotesHelper
data = {
line_code: line_code,
line_type: line_type,
line_type: line_type
}
if @use_legacy_diff_notes
......
......@@ -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
......@@ -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
......@@ -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
[]
......
......@@ -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
......@@ -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
......
......@@ -63,7 +63,7 @@ module TodosHelper
project_id: params[:project_id],
author_id: params[:author_id],
type: params[:type],
action_id: params[:action_id],
action_id: params[:action_id]
}
end
......
......@@ -33,7 +33,7 @@ class Blob < SimpleDelegator
BlobViewer::PDF,
BlobViewer::BinarySTL,
BlobViewer::TextSTL,
BlobViewer::TextSTL
].freeze
BINARY_VIEWERS = RICH_VIEWERS.select(&:binary?).freeze
......
......@@ -49,7 +49,7 @@ class Commit
def max_diff_options
{
max_files: DIFF_HARD_LIMIT_FILES,
max_lines: DIFF_HARD_LIMIT_LINES,
max_lines: DIFF_HARD_LIMIT_LINES
}
end
......
......@@ -39,7 +39,7 @@ class DiffDiscussion < Discussion
def reply_attributes
super.merge(
original_position: original_position.to_json,
position: position.to_json,
position: position.to_json
)
end
end
......@@ -62,7 +62,7 @@ class Environment < ActiveRecord::Base
def predefined_variables
[
{ key: 'CI_ENVIRONMENT_NAME', value: name, public: true },
{ key: 'CI_ENVIRONMENT_SLUG', value: slug, public: true },
{ key: 'CI_ENVIRONMENT_SLUG', value: slug, public: true }
]
end
......
......@@ -31,7 +31,7 @@ class WebHook < ActiveRecord::Base
post_url = url.gsub("#{parsed_url.userinfo}@", '')
auth = {
username: CGI.unescape(parsed_url.user),
password: CGI.unescape(parsed_url.password),
password: CGI.unescape(parsed_url.password)
}
response = WebHook.post(post_url,
body: data.to_json,
......
......@@ -74,7 +74,7 @@ class Key < ActiveRecord::Base
GitlabShellWorker.perform_async(
:remove_key,
shell_id,
key,
key
)
end
......
......@@ -56,7 +56,7 @@ class Namespace < ActiveRecord::Base
'COALESCE(SUM(ps.storage_size), 0) AS storage_size',
'COALESCE(SUM(ps.repository_size), 0) AS repository_size',
'COALESCE(SUM(ps.lfs_objects_size), 0) AS lfs_objects_size',
'COALESCE(SUM(ps.build_artifacts_size), 0) AS build_artifacts_size',
'COALESCE(SUM(ps.build_artifacts_size), 0) AS build_artifacts_size'
)
end
......
......@@ -967,7 +967,7 @@ class Project < ActiveRecord::Base
namespace: namespace.name,
visibility_level: visibility_level,
path_with_namespace: path_with_namespace,
default_branch: default_branch,
default_branch: default_branch
}
# Backward compatibility
......
......@@ -52,7 +52,7 @@ class BambooService < CiService
placeholder: 'Bamboo build plan key like KEY' },
{ type: 'text', name: 'username',
placeholder: 'A user with API access, if applicable' },
{ type: 'password', name: 'password' },
{ type: 'password', name: 'password' }
]
end
......
......@@ -39,7 +39,7 @@ class ChatNotificationService < Service
{ type: 'text', name: 'webhook', placeholder: "e.g. #{webhook_placeholder}" },
{ type: 'text', name: 'username', placeholder: 'e.g. GitLab' },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
{ type: 'checkbox', name: 'notify_only_default_branch' },
{ type: 'checkbox', name: 'notify_only_default_branch' }
]
end
......
......@@ -47,7 +47,7 @@ class EmailsOnPushService < Service
help: "Send notifications from the committer's email address if the domain is part of the domain GitLab is running on (e.g. #{domains})." },
{ type: 'checkbox', name: 'disable_diffs', title: "Disable code diffs",
help: "Don't include possibly sensitive code diffs in notification body." },
{ type: 'textarea', name: 'recipients', placeholder: 'Emails separated by whitespace' },
{ type: 'textarea', name: 'recipients', placeholder: 'Emails separated by whitespace' }
]
end
end
......@@ -19,7 +19,7 @@ class ExternalWikiService < Service
def fields
[
{ type: 'text', name: 'external_wiki_url', placeholder: 'The URL of the external Wiki' },
{ type: 'text', name: 'external_wiki_url', placeholder: 'The URL of the external Wiki' }
]
end
......
......@@ -37,7 +37,7 @@ class FlowdockService < Service
repo: project.repository.path_to_repo,
repo_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}",
commit_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/commit/%s",
diff_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/compare/%s...%s",
diff_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/compare/%s...%s"
)
end
end
......@@ -41,7 +41,7 @@ class HipchatService < Service
placeholder: 'Leave blank for default (v2)' },
{ type: 'text', name: 'server',
placeholder: 'Leave blank for default. https://hipchat.example.com' },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' }
]
end
......
......@@ -58,7 +58,7 @@ class IrkerService < Service
' want to use a password, you have to omit the "#" on the channel). If you ' \
' specify a default IRC URI to prepend before each recipient, you can just ' \
' give a channel name.' },
{ type: 'checkbox', name: 'colorize_messages' },
{ type: 'checkbox', name: 'colorize_messages' }
]
end
......
......@@ -149,7 +149,7 @@ class JiraService < IssueTrackerService
data = {
user: {
name: author.name,
url: resource_url(user_path(author)),
url: resource_url(user_path(author))
},
project: {
name: self.project.path_with_namespace,
......
......@@ -73,7 +73,7 @@ class KubernetesService < DeploymentService
{ type: 'textarea',
name: 'ca_pem',
title: 'Custom CA bundle',
placeholder: 'Certificate Authority bundle (PEM format)' },
placeholder: 'Certificate Authority bundle (PEM format)' }
]
end
......
......@@ -35,7 +35,7 @@ class MicrosoftTeamsService < ChatNotificationService
[
{ type: 'text', name: 'webhook', placeholder: "e.g. #{webhook_placeholder}" },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
{ type: 'checkbox', name: 'notify_only_default_branch' },
{ type: 'checkbox', name: 'notify_only_default_branch' }
]
end
......
......@@ -21,7 +21,7 @@ class MockCiService < CiService
[
{ type: 'text',
name: 'mock_service_url',
placeholder: 'http://localhost:4004' },
placeholder: 'http://localhost:4004' }
]
end
......
......@@ -55,7 +55,7 @@ class PipelinesEmailService < Service
name: 'recipients',
placeholder: 'Emails separated by comma' },
{ type: 'checkbox',
name: 'notify_only_broken_pipelines' },
name: 'notify_only_broken_pipelines' }
]
end
......
......@@ -55,7 +55,7 @@ class PushoverService < Service
['Pushover Echo (long)', 'echo'],
['Up Down (long)', 'updown'],
['None (silent)', 'none']
] },
] }
]
end
......
......@@ -55,7 +55,7 @@ class TeamcityService < CiService
placeholder: 'Build configuration ID' },
{ type: 'text', name: 'username',
placeholder: 'A user with permissions to trigger a manual build' },
{ type: 'password', name: 'password' },
{ type: 'password', name: 'password' }
]
end
......@@ -78,7 +78,7 @@ class TeamcityService < CiService
auth = {
username: username,
password: password,
password: password
}
branch = Gitlab::Git.ref_name(data[:ref])
......
......@@ -833,7 +833,7 @@ class Repository
actual_options = options.merge(
parents: [our_commit, their_commit],
tree: merge_index.write_tree(rugged),
tree: merge_index.write_tree(rugged)
)
commit_id = create_commit(actual_options)
......
......@@ -39,7 +39,7 @@ class SentNotification < ActiveRecord::Base
noteable_type: noteable.class.name,
noteable_id: noteable_id,
commit_id: commit_id,
commit_id: commit_id
)
create(attrs)
......
......@@ -16,7 +16,7 @@ class AkismetService
created_at: DateTime.now,
author: owner.name,
author_email: owner.email,
referrer: options[:referrer],
referrer: options[:referrer]
}
begin
......
......@@ -8,7 +8,7 @@ class AuditEventService
with: @details[:with],
target_id: @author.id,
target_type: 'User',
target_details: @author.name,
target_details: @author.name
}
self
......
......@@ -38,7 +38,7 @@ module Boards
attrs.merge!(
add_label_ids: add_label_ids,
remove_label_ids: remove_label_ids,
state_event: issue_state,
state_event: issue_state
)
end
......
......@@ -298,7 +298,7 @@ class NotificationService
recipients ||= NotificationRecipientService.new(pipeline.project).build_pipeline_recipients(
pipeline,
pipeline.user,
action: pipeline.status,
action: pipeline.status
).map(&:notification_email)
if recipients.any?
......
......@@ -27,7 +27,7 @@ module Projects
{
domain: domain.domain,
certificate: domain.certificate,
key: domain.key,
key: domain.key
}
end
end
......
......@@ -51,7 +51,7 @@ class SystemHooksService
path: model.path,
group_id: model.id,
owner_name: owner.respond_to?(:name) ? owner.name : nil,
owner_email: owner.respond_to?(:email) ? owner.email : nil,
owner_email: owner.respond_to?(:email) ? owner.email : nil
)
when GroupMember
data.merge!(group_member_data(model))
......@@ -113,7 +113,7 @@ class SystemHooksService
user_name: model.user.name,
user_email: model.user.email,
user_id: model.user.id,
group_access: model.human_access,
group_access: model.human_access
}
end
end
......@@ -8,7 +8,7 @@ module RepositoryCheck
Project.select(:id).find_in_batches(batch_size: 100) do |batch|
Project.where(id: batch.map(&:id)).update_all(
last_repository_check_failed: nil,
last_repository_check_at: nil,
last_repository_check_at: nil
)
end
end
......
......@@ -7,7 +7,7 @@ module RepositoryCheck
project = Project.find(project_id)
project.update_columns(
last_repository_check_failed: !check(project),
last_repository_check_at: Time.now,
last_repository_check_at: Time.now
)
end
......
......@@ -33,7 +33,7 @@ module ActiveRecord
affected_rows = relation.where(
self.class.primary_key => id,
lock_col => previous_lock_value,
lock_col => previous_lock_value
).update_all(
attributes_for_update(attribute_names).map do |name|
[name, _read_attribute(name)]
......
......@@ -3,7 +3,7 @@ module Hamlit
def call(template)
Engine.new(
generator: Temple::Generators::RailsOutputBuffer,
attr_quote: '"',
attr_quote: '"'
).call(template.source)
end
end
......@@ -11,7 +11,7 @@ end
ActionView::Template.register_template_handler(
:haml,
Hamlit::TemplateHandler.new,
Hamlit::TemplateHandler.new
)
Hamlit::Filters.remove_filter('coffee')
......
......@@ -23,21 +23,21 @@ if app.config.serve_static_files
host: dev_server.host,
port: dev_server.port,
manifest_host: dev_server.host,
manifest_port: dev_server.port,
manifest_port: dev_server.port
}
if Rails.env.development?
settings.merge!(
host: Gitlab.config.gitlab.host,
port: Gitlab.config.gitlab.port,
https: Gitlab.config.gitlab.https,
https: Gitlab.config.gitlab.https
)
app.config.middleware.insert_before(
Gitlab::Middleware::Static,
Gitlab::Middleware::WebpackProxy,
proxy_path: app.config.webpack.public_path,
proxy_host: dev_server.host,
proxy_port: dev_server.port,
proxy_port: dev_server.port
)
end
......
......@@ -69,7 +69,7 @@ class RemoveRedundantIndexes < ActiveRecord::Migration
[:namespaces, 'index_namespaces_on_created_at_and_id'],
[:notes, 'index_notes_on_created_at_and_id'],
[:projects, 'index_projects_on_created_at_and_id'],
[:users, 'index_users_on_created_at_and_id'],
[:users, 'index_users_on_created_at_and_id']
]
transaction do
......
......@@ -25,7 +25,7 @@ class AddMarkdownCacheColumns < ActiveRecord::Migration
notes: [:note],
projects: [:description],
releases: [:description],
snippets: [:title, :content],
snippets: [:title, :content]
}.freeze
def change
......
......@@ -101,7 +101,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
create(:merge_request,
title: "Bug fix for public project",
source_project: public_project,
target_project: public_project,
target_project: public_project
)
end
......
......@@ -24,7 +24,7 @@ module API
def present_groups(groups, options = {})
options = options.reverse_merge(
with: Entities::Group,
current_user: current_user,
current_user: current_user
)
groups = groups.with_statistics if options[:statistics]
......
......@@ -301,7 +301,7 @@ module API
UploadedFile.new(
file_path,
params["#{field}.name"],
params["#{field}.type"] || 'application/octet-stream',
params["#{field}.type"] || 'application/octet-stream'
)
end
......
......@@ -90,7 +90,7 @@ module API
{
api_version: API.version,
gitlab_version: Gitlab::VERSION,
gitlab_rev: Gitlab::REVISION,
gitlab_rev: Gitlab::REVISION
}
end
......
......@@ -69,7 +69,7 @@ module API
options = options.reverse_merge(
with: Entities::Project,
current_user: current_user,
simple: params[:simple],
simple: params[:simple]
)
projects = filter_projects(projects)
......@@ -226,7 +226,7 @@ module API
:shared_runners_enabled,
:snippets_enabled,
:visibility,
:wiki_enabled,
:wiki_enabled
]
optional :name, type: String, desc: 'The name of the project'
optional :default_branch, type: String, desc: 'The default branch of the project'
......
......@@ -356,7 +356,7 @@ module API
name: :ca_pem,
type: String,
desc: 'A custom certificate authority bundle to verify the Kubernetes cluster with (PEM format)'
},
}
],
'mattermost-slash-commands' => [
{
......@@ -559,7 +559,7 @@ module API
SlackService,
MattermostService,
MicrosoftTeamsService,
TeamcityService,
TeamcityService
]
if Rails.env.development?
......@@ -577,7 +577,7 @@ module API
service_classes += [
MockCiService,
MockDeploymentService,
MockMonitoringService,
MockMonitoringService
]
end
......
......@@ -5,7 +5,7 @@ module API
subscribable_types = {
'merge_requests' => proc { |id| find_merge_request_with_access(id, :update_merge_request) },
'issues' => proc { |id| find_project_issue(id) },
'labels' => proc { |id| find_project_label(id) },
'labels' => proc { |id| find_project_label(id) }
}
params do
......
......@@ -20,7 +20,7 @@ module API
def present_groups(groups, options = {})
options = options.reverse_merge(
with: Entities::Group,
current_user: current_user,
current_user: current_user
)
groups = groups.with_statistics if options[:statistics]
......
......@@ -88,7 +88,7 @@ module API
options = options.reverse_merge(
with: ::API::V3::Entities::Project,
current_user: current_user,
simple: params[:simple],
simple: params[:simple]
)
projects = filter_projects(projects)
......
......@@ -377,7 +377,7 @@ module API
name: :ca_pem,
type: String,
desc: 'A custom certificate authority bundle to verify the Kubernetes cluster with (PEM format)'
},
}
],
'mattermost-slash-commands' => [
{
......
......@@ -7,7 +7,7 @@ module API
'merge_request' => proc { |id| find_merge_request_with_access(id, :update_merge_request) },
'merge_requests' => proc { |id| find_merge_request_with_access(id, :update_merge_request) },
'issues' => proc { |id| find_project_issue(id) },
'labels' => proc { |id| find_project_label(id) },
'labels' => proc { |id| find_project_label(id) }
}
params do
......
......@@ -20,7 +20,7 @@ module Ci
italic: 0x02,
underline: 0x04,
conceal: 0x08,
cross: 0x10,
cross: 0x10
}.freeze
def self.convert(ansi, state = nil)
......
......@@ -70,7 +70,7 @@ module Ci
cache: job[:cache],
dependencies: job[:dependencies],
after_script: job[:after_script],
environment: job[:environment],
environment: job[:environment]
}.compact
}
end
......
......@@ -32,7 +32,7 @@ module Gitlab
"Guest" => GUEST,
"Reporter" => REPORTER,
"Developer" => DEVELOPER,
"Master" => MASTER,
"Master" => MASTER
}
end
......@@ -47,7 +47,7 @@ module Gitlab
guest: GUEST,
reporter: REPORTER,
developer: DEVELOPER,
master: MASTER,
master: MASTER
}
end
......@@ -60,7 +60,7 @@ module Gitlab
"Not protected: Both developers and masters can push new commits, force push, or delete the branch." => PROTECTION_NONE,
"Protected against pushes: Developers cannot push new commits, but are allowed to accept merge requests to the branch." => PROTECTION_DEV_CAN_MERGE,
"Partially protected: Developers can push new commits, but cannot force push or delete the branch. Masters can do all of those." => PROTECTION_DEV_CAN_PUSH,
"Fully protected: Developers cannot push new commits, force push, or delete the branch. Only masters can do any of those." => PROTECTION_FULL,
"Fully protected: Developers cannot push new commits, force push, or delete the branch. Only masters can do any of those." => PROTECTION_FULL
}
end
......
......@@ -5,7 +5,7 @@ module Gitlab
Gitlab::ChatCommands::IssueShow,
Gitlab::ChatCommands::IssueNew,
Gitlab::ChatCommands::IssueSearch,
Gitlab::ChatCommands::Deploy,
Gitlab::ChatCommands::Deploy
].freeze
def execute
......
......@@ -7,7 +7,7 @@ module Gitlab
test: :read_build,
review: :read_merge_request,
staging: :read_build,
production: :read_issue,
production: :read_issue
}.freeze
def self.get(*args)
......
......@@ -36,7 +36,7 @@ module Gitlab
user: {
id: user.try(:id),
name: user.try(:name),
email: user.try(:email),
email: user.try(:email)
},
commit: {
......@@ -49,7 +49,7 @@ module Gitlab
status: commit.status,
duration: commit.duration,
started_at: commit.started_at,
finished_at: commit.finished_at,
finished_at: commit.finished_at
},
repository: {
......@@ -60,7 +60,7 @@ module Gitlab
git_http_url: project.http_url_to_repo,
git_ssh_url: project.ssh_url_to_repo,
visibility_level: project.visibility_level
},
}
}
data
......
......@@ -40,7 +40,7 @@ module Gitlab
Gitlab::EtagCaching::Router::Route.new(
%r(^(?!.*(#{RESERVED_WORDS})).*/pipelines/\d+\.json\z),
'project_pipeline'
),
)
].freeze
def self.match(env)
......
......@@ -90,7 +90,7 @@ module Gitlab
name: blob_entry[:name],
data: '',
path: path,
commit_id: sha,
commit_id: sha
)
end
end
......
......@@ -258,7 +258,7 @@ module Gitlab
'RepoPath' => path,
'ArchivePrefix' => prefix,
'ArchivePath' => archive_file_path(prefix, storage_path, format),
'CommitId' => commit.id,
'CommitId' => commit.id
}
end
......
......@@ -35,7 +35,7 @@ module Gitlab
type: entry[:type],
mode: entry[:filemode].to_s(8),
path: path ? File.join(path, entry[:name]) : entry[:name],
commit_id: sha,
commit_id: sha
)
end
end
......
......@@ -34,7 +34,7 @@ module Gitlab
left_commit_id: parent_id,
right_commit_id: commit.id,
ignore_whitespace_change: options.fetch(:ignore_whitespace_change, false),
paths: options.fetch(:paths, []),
paths: options.fetch(:paths, [])
)
Gitlab::Git::DiffCollection.new(stub.commit_diff(request), options)
......
......@@ -6,7 +6,7 @@ module Gitlab
Gitaly::Repository.new(
path: File.join(Gitlab.config.repositories.storages[repository_storage]['path'], relative_path),
storage_name: repository_storage,
relative_path: relative_path,
relative_path: relative_path
)
end
end
......
......@@ -38,7 +38,7 @@ module Gitlab
url: container_exec_url(api_url, namespace, pod_name, container["name"]),
subprotocols: ['channel.k8s.io'],
headers: Hash.new { |h, k| h[k] = [] },
created_at: created_at,
created_at: created_at
}
end
end
......@@ -64,7 +64,7 @@ module Gitlab
tty: true,
stdin: true,
stdout: true,
stderr: true,
stderr: true
}.to_query + '&' + EXEC_COMMAND
case url.scheme
......
......@@ -39,7 +39,7 @@ module Gitlab
def adapter_options
opts = base_options.merge(
encryption: encryption,
encryption: encryption
)
opts.merge!(auth_options) if has_auth?
......
......@@ -11,7 +11,7 @@ module Gitlab
Raven.user_context(
id: current_user.id,
email: current_user.email,
username: current_user.username,
username: current_user.username
)
end
end
......
......@@ -22,7 +22,7 @@ module Gitlab
params = {
GL_ID: Gitlab::GlId.gl_id(user),
GL_REPOSITORY: Gitlab::GlRepository.gl_repository(project, is_wiki),
RepoPath: repo_path,
RepoPath: repo_path
}
if Gitlab.config.gitaly.enabled
......@@ -51,7 +51,7 @@ module Gitlab
{
StoreLFSPath: "#{Gitlab.config.lfs.storage_path}/tmp/upload",
LfsOid: oid,
LfsSize: size,
LfsSize: size
}
end
......@@ -62,7 +62,7 @@ module Gitlab
def send_git_blob(repository, blob)
params = {
'RepoPath' => repository.path_to_repo,
'BlobId' => blob.id,
'BlobId' => blob.id
}
[
......@@ -127,7 +127,7 @@ module Gitlab
'Subprotocols' => terminal[:subprotocols],
'Url' => terminal[:url],
'Header' => terminal[:headers],
'MaxSessionTime' => terminal[:max_session_time],
'MaxSessionTime' => terminal[:max_session_time]
}
}
details['Terminal']['CAPem'] = terminal[:ca_pem] if terminal.has_key?(:ca_pem)
......@@ -165,7 +165,7 @@ module Gitlab
encoded_message,
secret,
true,
{ iss: 'gitlab-workhorse', verify_iss: true, algorithm: 'HS256' },
{ iss: 'gitlab-workhorse', verify_iss: true, algorithm: 'HS256' }
)
end
......
......@@ -21,7 +21,7 @@ namespace :gemojione do
moji: emoji_hash['moji'],
description: emoji_hash['description'],
unicodeVersion: Gitlab::Emoji.emoji_unicode_version(name),
digest: hash_digest,
digest: hash_digest
}
resultant_emoji_map[name] = entry
......
......@@ -49,7 +49,7 @@ namespace :gitlab do
Template.new(
"https://gitlab.com/gitlab-org/Dockerfile.git",
/(\.{1,2}|LICENSE|CONTRIBUTING.md|\.Dockerfile)\z/
),
)
].freeze
def vendor_directory
......
......@@ -60,7 +60,7 @@ desc "GitLab | Run specs"
task :spec do
cmds = [
%w(rake gitlab:setup),
%w(rspec spec),
%w(rspec spec)
]
run_commands(cmds)
end
......
......@@ -8,7 +8,7 @@ params = {
"ref" => ENV["OMNIBUS_BRANCH"] || "master",
"token" => ENV["BUILD_TRIGGER_TOKEN"],
"variables[GITLAB_VERSION]" => ENV["CI_COMMIT_SHA"],
"variables[ALTERNATIVE_SOURCES]" => true,
"variables[ALTERNATIVE_SOURCES]" => true
}
Dir.glob("*_VERSION").each do |version_file|
......
......@@ -68,7 +68,7 @@ describe GroupsController do
before do
create_list(:award_emoji, 3, awardable: issue_2)
create_list(:award_emoji, 2, awardable: issue_1)
create_list(:award_emoji, 2, :downvote, awardable: issue_2,)
create_list(:award_emoji, 2, :downvote, awardable: issue_2)
sign_in(user)
end
......
......@@ -22,7 +22,7 @@ FactoryGirl.define do
properties({
namespace: 'somepath',
api_url: 'https://kubernetes.example.com',
token: 'a' * 40,
token: 'a' * 40
})
end
......
......@@ -23,7 +23,7 @@ feature 'Admin uses repository checks', feature: true do
project = create(:empty_project)
project.update_columns(
last_repository_check_failed: true,
last_repository_check_at: Time.now,
last_repository_check_at: Time.now
)
visit_admin_project_page(project)
......
......@@ -10,7 +10,7 @@ describe 'Auto deploy' do
properties: {
namespace: project.path,
api_url: 'https://kubernetes.example.com',
token: 'a' * 40,
token: 'a' * 40
}
)
project.team << [user, :master]
......
......@@ -96,7 +96,7 @@ describe 'Copy as GFM', feature: true, js: true do
# issue link
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue)})",
# issue link with note anchor
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123')})",
"[Issue](#{namespace_project_issue_url(@project.namespace, @project, @feat.issue, anchor: 'note_123')})"
)
verify(
......
......@@ -151,7 +151,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
'conflict-too-large' => 'when the conflicts contain a large file',
'conflict-binary-file' => 'when the conflicts contain a binary file',
'conflict-missing-side' => 'when the conflicts contain a file edited in one branch and deleted in another',
'conflict-non-utf8' => 'when the conflicts contain a non-UTF-8 file',
'conflict-non-utf8' => 'when the conflicts contain a non-UTF-8 file'
}.freeze
UNRESOLVABLE_CONFLICTS.each do |source_branch, description|
......
......@@ -74,7 +74,7 @@ describe 'Edit Project Settings', feature: true do
issues: namespace_project_issues_path(project.namespace, project),
wiki: namespace_project_wiki_path(project.namespace, project, :home),
snippets: namespace_project_snippets_path(project.namespace, project),
merge_requests: namespace_project_merge_requests_path(project.namespace, project),
merge_requests: namespace_project_merge_requests_path(project.namespace, project)
}
end
......
......@@ -22,7 +22,7 @@ describe 'Pipelines', :feature, :js do
project: project,
ref: 'master',
status: 'running',
sha: project.commit.id,
sha: project.commit.id
)
end
......
......@@ -225,7 +225,7 @@ module Ci
before_script: ["pwd"],
rspec: { script: "rspec", type: "test", only: %w(master deploy) },
staging: { script: "deploy", type: "deploy", only: %w(master deploy) },
production: { script: "deploy", type: "deploy", only: ["master@path", "deploy"] },
production: { script: "deploy", type: "deploy", only: ["master@path", "deploy"] }
})
config_processor = GitlabCiYamlProcessor.new(config, 'fork')
......@@ -381,7 +381,7 @@ module Ci
before_script: ["pwd"],
rspec: { script: "rspec", type: "test", except: ["master", "deploy", "test@fork"] },
staging: { script: "deploy", type: "deploy", except: ["master"] },
production: { script: "deploy", type: "deploy", except: ["master@fork"] },
production: { script: "deploy", type: "deploy", except: ["master@fork"] }
})
config_processor = GitlabCiYamlProcessor.new(config, 'fork')
......@@ -716,7 +716,7 @@ module Ci
expect(config_processor.builds_for_stage_and_ref("test", "master").first[:options][:cache]).to eq(
paths: ["logs/", "binaries/"],
untracked: true,
key: 'key',
key: 'key'
)
end
......@@ -734,7 +734,7 @@ module Ci
expect(config_processor.builds_for_stage_and_ref("test", "master").first[:options][:cache]).to eq(
paths: ["logs/", "binaries/"],
untracked: true,
key: 'key',
key: 'key'
)
end
......@@ -743,7 +743,7 @@ module Ci
cache: { paths: ["logs/", "binaries/"], untracked: true, key: 'global' },
rspec: {
script: "rspec",
cache: { paths: ["test/"], untracked: false, key: 'local' },
cache: { paths: ["test/"], untracked: false, key: 'local' }
}
})
......@@ -753,7 +753,7 @@ module Ci
expect(config_processor.builds_for_stage_and_ref("test", "master").first[:options][:cache]).to eq(
paths: ["test/"],
untracked: false,
key: 'local',
key: 'local'
)
end
end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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