Skip to content

Commit

Permalink
rubocop fix for Layout/AlignHash
Browse files Browse the repository at this point in the history
Layout/AlignHash behaves different in 0.60 than in 0.59
the both PRs (#6144 and #6177) were merged independently
  • Loading branch information
vpereira authored and coolo committed Nov 14, 2018
1 parent 526e86c commit d1be47f
Show file tree
Hide file tree
Showing 109 changed files with 966 additions and 966 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/cloud/upload_jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy
rescue ::Backend::Error => exception
render_error status: 500,
errorcode: 'cloud_upload_job_error',
message: exception.message
message: exception.message
end

private
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/source_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def project_command_move

begin
project = Project.get_by_name(params[:oproject])
commit = { login: User.current.login,
commit = { login: User.current.login,
lowprio: 1,
comment: "Project move from #{params[:oproject]} to #{params[:project]}" }
commit[:comment] = params[:comment] if params[:comment].present?
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/source_project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def delete
end
project.check_weak_dependencies!
opts = { no_write_to_backend: true,
force: params[:force].present?,
recursive_remove: params[:remove_linking_repositories].present? }
force: params[:force].present?,
recursive_remove: params[:remove_linking_repositories].present? }
check_and_remove_repositories!(project.repositories, opts)

logger.info "destroying project object #{project.name}"
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/source_project_meta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def update
def remove_repositories!(project, request_data, params)
remove_repositories = project.get_removed_repositories(request_data)
opts = { no_write_to_backend: true,
force: params[:force].present?,
recursive_remove: params[:remove_linking_repositories].present? }
force: params[:force].present?,
recursive_remove: params[:remove_linking_repositories].present? }
check_and_remove_repositories!(remove_repositories, opts)
end

Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/trigger_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def runservice
if pkg
# check if user has still access
unless token.user.is_active? && token.user.can_modify?(pkg)
render_error message: "no permission for package #{pkg.name} in project #{pkg.project.name}",
status: 403,
render_error message: "no permission for package #{pkg.name} in project #{pkg.project.name}",
status: 403,
errorcode: 'no_permission'
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create
begin
ActiveRecord::Base.transaction do
@download_on_demand.repository.repository_architectures.where(
repository: @download_on_demand.repository,
repository: @download_on_demand.repository,
architecture: Architecture.find_by_name(permitted_params[:arch])
).first_or_create!
@download_on_demand.save!
Expand All @@ -29,7 +29,7 @@ def update
begin
ActiveRecord::Base.transaction do
@download_on_demand.repository.repository_architectures.where(
repository: @download_on_demand.repository,
repository: @download_on_demand.repository,
architecture: Architecture.find_by_name(permitted_params[:arch])
).first_or_create!
@download_on_demand.update_attributes!(permitted_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class BsRequestsController < WebuiController

REQUEST_METHODS = {
'all_requests_table' => :requests,
'requests_in_table' => :incoming_requests,
'reviews_in_table' => :involved_reviews
'requests_in_table' => :incoming_requests,
'reviews_in_table' => :involved_reviews
}.freeze

private
Expand Down
14 changes: 7 additions & 7 deletions src/api/app/controllers/webui/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ def submit_request
begin
r = BsRequest.find_by_number!(request_number)
opts = {
newstate: 'superseded',
reason: "Superseded by request #{req.number}",
newstate: 'superseded',
reason: "Superseded by request #{req.number}",
superseded_by: req.number
}
r.change_state(opts)
Expand Down Expand Up @@ -431,10 +431,10 @@ def find_last_req
return # ignore all !declined
end
return {
id: last_req.number,
id: last_req.number,
decliner: last_req.commenter,
when: last_req.updated_at,
comment: last_req.comment
when: last_req.updated_at,
comment: last_req.comment
}
end
return
Expand Down Expand Up @@ -1136,8 +1136,8 @@ def check_build_log_access
end

begin
@package = Package.get_by_project_and_name(@project, params[:package], use_source: false,
follow_multibuild: true,
@package = Package.get_by_project_and_name(@project, params[:package], use_source: false,
follow_multibuild: true,
follow_project_links: true)
rescue Package::UnknownObjectError
redirect_to project_show_path(@project.to_param),
Expand Down
22 changes: 11 additions & 11 deletions src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def change_state(newstate, params)
# FIXME: make force optional, it hides warnings!
opts = {
newstate: newstate,
force: true,
user: User.current.login,
comment: params[:reason]
force: true,
user: User.current.login,
comment: params[:reason]
}
begin
request.change_state(opts)
Expand Down Expand Up @@ -384,15 +384,15 @@ def forward_request_to(fwd)

def request_action_attributes(type)
{
target_project: params[:project],
target_package: params[:package],
source_project: params[:devel_project],
source_package: params[:devel_package] || params[:package],
target_project: params[:project],
target_package: params[:package],
source_project: params[:devel_project],
source_package: params[:devel_package] || params[:package],
target_repository: params[:repository],
person_name: params[:user],
group_name: params[:group],
role: params[:role],
type: type.to_s
person_name: params[:user],
group_name: params[:group],
role: params[:role],
type: type.to_s
}
end
end
8 changes: 4 additions & 4 deletions src/api/app/controllers/webui/users/bs_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class BsRequestsController < WebuiController
before_action :set_user

REQUEST_METHODS = {
'all_requests_table' => :requests,
'requests_out_table' => :outgoing_requests,
'all_requests_table' => :requests,
'requests_out_table' => :outgoing_requests,
'requests_declined_table' => :declined_requests,
'requests_in_table' => :incoming_requests,
'reviews_in_table' => :involved_reviews
'requests_in_table' => :incoming_requests,
'reviews_in_table' => :involved_reviews
}.freeze

private
Expand Down
14 changes: 7 additions & 7 deletions src/api/app/helpers/flag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ class InvalidFlag < APIError
end

TYPES = {
'lock' => :disable,
'build' => :enable,
'publish' => :enable,
'debuginfo' => :disable,
'useforbuild' => :enable,
'lock' => :disable,
'build' => :enable,
'publish' => :enable,
'debuginfo' => :disable,
'useforbuild' => :enable,
'binarydownload' => :enable,
'sourceaccess' => :enable,
'access' => :enable
'sourceaccess' => :enable,
'access' => :enable
}.freeze

def self.default_for(flag_type)
Expand Down
36 changes: 18 additions & 18 deletions src/api/app/helpers/maintenance_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def release_package_relink(link, action, target_package_name, target_project, tp
md5 = Digest::MD5.hexdigest(link_xml)
# commit with noservice parameter
upload_params = {
user: User.current.login,
cmd: 'commitfilelist',
user: User.current.login,
cmd: 'commitfilelist',
noservice: '1',
comment: "Set local link to #{target_package_name} via maintenance_release request"
comment: "Set local link to #{target_package_name} via maintenance_release request"
}
upload_params[:requestid] = action.bs_request.number if action
upload_path = "/source/#{URI.escape(target_project.name)}/#{URI.escape(target_package_name)}"
Expand All @@ -123,8 +123,8 @@ def release_package_create_main_package(request, source_package, target_package_
lpkg.store
end
upload_params = {
user: User.current.login,
rev: 'repository',
user: User.current.login,
rev: 'repository',
comment: "Set link to #{target_package_name} via maintenance_release request"
}
upload_path = "/source/#{URI.escape(target_project.name)}/#{URI.escape(base_package_name)}/_link"
Expand All @@ -146,14 +146,14 @@ def release_package_copy_sources(action, source_package, target_package_name, ta
# backend copy of current sources as full copy
# that means the xsrcmd5 is different, but we keep the incident project anyway.
cp_params = {
cmd: 'copy',
user: User.current.login,
oproject: source_package.project.name,
opackage: source_package.name,
comment: "Release from #{source_package.project.name} / #{source_package.name}",
expand: '1',
withvrev: '1',
noservice: '1',
cmd: 'copy',
user: User.current.login,
oproject: source_package.project.name,
opackage: source_package.name,
comment: "Release from #{source_package.project.name} / #{source_package.name}",
expand: '1',
withvrev: '1',
noservice: '1',
withacceptinfo: '1'
}
cp_params[:requestid] = action.bs_request.number if action
Expand Down Expand Up @@ -216,12 +216,12 @@ def copy_binaries_to_repository(source_repository, source_package, target_repo,
def copy_single_binary(arch, target_repository, source_project_name, source_package_name, source_repo,
target_package_name, update_info_id, setrelease)
cp_params = {
cmd: 'copy',
oproject: source_project_name,
opackage: source_package_name,
cmd: 'copy',
oproject: source_project_name,
opackage: source_package_name,
orepository: source_repo.name,
user: User.current.login,
resign: '1'
user: User.current.login,
resign: '1'
}
cp_params[:setupdateinfoid] = update_info_id if update_info_id
cp_params[:setrelease] = setrelease if setrelease
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/helpers/webui/project_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def remove_parent_name(project_name, parent_name)
end

STATE_ICONS = {
'new' => 'flag_green',
'review' => 'flag_yellow',
'new' => 'flag_green',
'review' => 'flag_yellow',
'declined' => 'flag_red'
}.freeze

Expand Down
8 changes: 4 additions & 4 deletions src/api/app/helpers/webui/request_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Webui::RequestHelper
STATE_COLORS = {
'new' => 'green',
'accepted' => 'green',
'revoked' => 'orange',
'declined' => 'red',
'new' => 'green',
'accepted' => 'green',
'revoked' => 'orange',
'declined' => 'red',
'superseded' => 'red'
}.freeze

Expand Down
74 changes: 37 additions & 37 deletions src/api/app/helpers/webui/webui_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,52 +62,52 @@ def format_projectname(prjname, login)
end

REPO_STATUS_ICONS = {
'published' => 'lorry',
'publishing' => 'cog_go',
'outdated_published' => 'lorry_error',
'outdated_publishing' => 'cog_error',
'unpublished' => 'lorry_flatbed',
'published' => 'lorry',
'publishing' => 'cog_go',
'outdated_published' => 'lorry_error',
'outdated_publishing' => 'cog_error',
'unpublished' => 'lorry_flatbed',
'outdated_unpublished' => 'lorry_error',
'building' => 'cog',
'outdated_building' => 'cog_error',
'finished' => 'time',
'outdated_finished' => 'time_error',
'blocked' => 'time',
'outdated_blocked' => 'time_error',
'broken' => 'exclamation',
'outdated_broken' => 'exclamation',
'scheduling' => 'cog',
'outdated_scheduling' => 'cog_error'
'building' => 'cog',
'outdated_building' => 'cog_error',
'finished' => 'time',
'outdated_finished' => 'time_error',
'blocked' => 'time',
'outdated_blocked' => 'time_error',
'broken' => 'exclamation',
'outdated_broken' => 'exclamation',
'scheduling' => 'cog',
'outdated_scheduling' => 'cog_error'
}.freeze

WEBUI2_REPO_STATUS_ICONS = {
'published' => 'truck',
'outdated_published' => 'truck',
'publishing' => 'truck-loading',
'outdated_publishing' => 'truck-loading',
'unpublished' => 'dolly-flatbed',
'published' => 'truck',
'outdated_published' => 'truck',
'publishing' => 'truck-loading',
'outdated_publishing' => 'truck-loading',
'unpublished' => 'dolly-flatbed',
'outdated_unpublished' => 'dolly-flatbed',
'building' => 'cog',
'outdated_building' => 'cog',
'finished' => 'check',
'outdated_finished' => 'check',
'blocked' => 'lock',
'outdated_blocked' => 'lock',
'broken' => 'exclamation-triangle',
'outdated_broken' => 'exclamation-triangle',
'scheduling' => 'calendar-alt',
'outdated_scheduling' => 'calendar-alt'
'building' => 'cog',
'outdated_building' => 'cog',
'finished' => 'check',
'outdated_finished' => 'check',
'blocked' => 'lock',
'outdated_blocked' => 'lock',
'broken' => 'exclamation-triangle',
'outdated_broken' => 'exclamation-triangle',
'scheduling' => 'calendar-alt',
'outdated_scheduling' => 'calendar-alt'
}.freeze

REPO_STATUS_DESCRIPTIONS = {
'published' => 'Repository has been published',
'publishing' => 'Repository is being created right now',
'published' => 'Repository has been published',
'publishing' => 'Repository is being created right now',
'unpublished' => 'Build finished, but repository publishing is disabled',
'building' => 'Build jobs exists',
'finished' => 'Build jobs have been processed, new repository is not yet created',
'blocked' => 'No build possible atm, waiting for jobs in other repositories',
'broken' => 'The repository setup is broken, build or publish not possible',
'scheduling' => 'The repository state is being calculated right now'
'building' => 'Build jobs exists',
'finished' => 'Build jobs have been processed, new repository is not yet created',
'blocked' => 'No build possible atm, waiting for jobs in other repositories',
'broken' => 'The repository setup is broken, build or publish not possible',
'scheduling' => 'The repository state is being calculated right now'
}.freeze

def check_first(first)
Expand Down
8 changes: 4 additions & 4 deletions src/api/app/mixins/parse_package_diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def parse_one_diff(sourcediff)
end

{
'old' => sourcediff['old'],
'new' => sourcediff['new'],
'old' => sourcediff['old'],
'new' => sourcediff['new'],
'filenames' => changes_file_keys.sort + spec_file_keys.sort + patch_file_keys.sort + other_file_keys.sort,
'files' => files_hash,
'issues' => issues_hash(sourcediff)
'files' => files_hash,
'issues' => issues_hash(sourcediff)
}
end

Expand Down

0 comments on commit d1be47f

Please sign in to comment.