Skip to content

Commit

Permalink
[ci] Fix MultilineArrayBraceLayout complains
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Dec 13, 2017
1 parent f0f9344 commit 2c37e3f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 30 deletions.
12 changes: 0 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ Layout/DotPosition:
Layout/IndentHash:
Enabled: false

# Offense count: 29
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineArrayBraceLayout:
Exclude:
- 'src/api/app/models/user.rb'
- 'src/api/lib/tasks/extract.rake'
- 'src/api/lib/xpath_engine.rb'
- 'src/api/test/functional/attributes_test.rb'
- 'src/api/test/functional/request_controller_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/MultilineBlockLayout:
Expand Down
3 changes: 2 additions & 1 deletion src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,8 @@ def user_relevant_packages_for_status
# No maintainers
packages = packages.where([
'(relationships.user_id = ?) OR '\
'(relationships.user_id is null AND packages.project_id in (?) )', id, projects_ids])
'(relationships.user_id is null AND packages.project_id in (?) )', id, projects_ids
])
packages.pluck(:id)
end

Expand Down
3 changes: 1 addition & 2 deletions src/api/lib/tasks/extract.rake
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ namespace :db do
end
if %w(event_subscriptions ratings package_kinds package_issues
linked_db_projects relationships watched_projects path_elements groups_users
flags taggings bs_request_histories bs_request_actions project_log_entries
).include? table_name
flags taggings bs_request_histories bs_request_actions project_log_entries).include? table_name
record.delete(primary)
t = record.to_a.sort
# a bit clumpsy but reliable order is important for git diff
Expand Down
18 changes: 6 additions & 12 deletions src/api/lib/xpath_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,18 @@ def find(xpath)
'LEFT JOIN issues AS attribissues ON attribissues.id = attrib_issues.issue_id',
'LEFT JOIN issue_trackers AS attribissue_trackers ON attribissues.issue_tracker_id = attribissue_trackers.id',
'LEFT JOIN relationships user_relation ON packages.id = user_relation.package_id',
'LEFT JOIN relationships group_relation ON packages.id = group_relation.package_id'
] << @joins
'LEFT JOIN relationships group_relation ON packages.id = group_relation.package_id'] << @joins
when 'projects'
relation = Project.all
@joins = ['LEFT JOIN relationships user_relation ON projects.id = user_relation.project_id',
'LEFT JOIN relationships group_relation ON projects.id = group_relation.project_id'
] << @joins
'LEFT JOIN relationships group_relation ON projects.id = group_relation.project_id'] << @joins
when 'repositories'
relation = Repository.where("repositories.db_project_id not in (?)", Relationship.forbidden_project_ids)
@joins = ['LEFT join path_elements path_element on path_element.parent_id=repositories.id',
'LEFT join repositories path_repo on path_element.repository_id=path_repo.id',
'LEFT join release_targets release_target on release_target.repository_id=repositories.id',
'LEFT join product_update_repositories product_update_repository on product_update_repository.repository_id=release_target.target_repository_id',
'LEFT join products product on product.id=product_update_repository.product_id '
] << @joins
'LEFT join products product on product.id=product_update_repository.product_id '] << @joins
when 'requests'
relation = BsRequest.all
attrib = AttribType.find_by_namespace_and_name('OBS', 'IncidentPriority')
Expand All @@ -343,13 +340,11 @@ def find(xpath)
@joins = ['LEFT join channel_binary_lists channel_binary_list on channel_binary_list.id=channel_binaries.channel_binary_list_id',
'LEFT join channels channel on channel.id=channel_binary_list.channel_id',
'LEFT join packages cpkg on cpkg.id=channel.package_id',
'LEFT join projects cprj on cprj.id=cpkg.project_id'
] << @joins
'LEFT join projects cprj on cprj.id=cpkg.project_id'] << @joins
when 'channel_binaries'
relation = ChannelBinary.all
@joins = ['LEFT join channel_binary_lists channel_binary_list on channel_binary_list.id=channel_binaries.channel_binary_list_id',
'LEFT join channels channel on channel.id=channel_binary_list.channel_id'
] << @joins
'LEFT join channels channel on channel.id=channel_binary_list.channel_id'] << @joins
when 'released_binaries'
relation = BinaryRelease.all

Expand All @@ -358,8 +353,7 @@ def find(xpath)
'LEFT join product_media on (product_media.repository_id=release_repositories.id AND product_media.name=binary_releases.medium)',
'LEFT join products product_ga on product_ga.id=product_media.product_id ',
'LEFT join product_update_repositories product_update_repository on product_update_repository.repository_id=release_repositories.id',
'LEFT join products product_update on product_update.id=product_update_repository.product_id '
] << @joins
'LEFT join products product_update on product_update.id=product_update_repository.product_id '] << @joins
order = :binary_releasetime
else
logger.debug "strange base table: #{@base_table}"
Expand Down
3 changes: 1 addition & 2 deletions src/api/test/functional/attributes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,7 @@ def test_create_attributes_package
get "/source/kde4/kdelibs/_attribute/OBS:Maintained"
assert_response :success
assert_equal({"attribute" => [{"name" => "Maintained", "namespace" => "OBS"},
{"name" => "Maintained", "namespace" => "OBS", "binary" => "kdelibs-devel"}
]},
{"name" => "Maintained", "namespace" => "OBS", "binary" => "kdelibs-devel"}]},
Xmlhash.parse(@response.body))
get "/source/kde4/kdelibs/kdelibs-devel/_attribute"
assert_response :success
Expand Down
3 changes: 2 additions & 1 deletion src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@ def test_create_request_and_multiple_reviews
{ "description" => "Request got reviewed",
'who' => 'tom',
'when' => '2010-07-12T00:00:04',
'comment' => 'review2' }]
'comment' => 'review2' }
]
}, node)
end

Expand Down

0 comments on commit 2c37e3f

Please sign in to comment.