Skip to content

Commit

Permalink
[ci] Fix ClosingParenthesisIndentation complains
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Dec 11, 2017
1 parent d36473e commit b782fad
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 44 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 31
# Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation:
Exclude:
- 'src/api/app/views/statistics/rating.xml.builder'
- 'src/api/test/unit/project_test.rb'

# Offense count: 68
# Cop supports --auto-correct.
Layout/CommentIndentation:
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/statistics/rating.xml.builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ if @package && @project
xml.rating( @rating[:score],
:count => @rating[:count], :project => @project, :package => @package,
:user_score => @rating[:user_score]
)
)
elsif @project
xml.rating( @rating[:score],
:count => @rating[:count], :project => @project,
:user_score => @rating[:user_score]
)
)
else
xml.rating
end
Expand Down
66 changes: 31 additions & 35 deletions src/api/test/unit/project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_flags_inheritance
<arch>x86_64</arch>
</repository>
</project>"
)
)

project.update_from_xml(axml)
project.store
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_flags_inheritance
<arch>x86_64</arch>
</repository>
</project>"
)
)

project.update_from_xml!(axml)
project.store
Expand Down Expand Up @@ -280,7 +280,7 @@ def test_flags_inheritance
<arch>x86_64</arch>
</repository>
</project>"
)
)

project2.update_from_xml(axml)
project2.store
Expand Down Expand Up @@ -410,7 +410,7 @@ def test_add_new_flags_from_xml
<disable repository='10.0' arch='i586'/>
</debuginfo>
</project>"
)
)

position = 1
%w(build publish debuginfo).each do |flagtype|
Expand Down Expand Up @@ -459,7 +459,7 @@ def test_delete_flags_through_xml
<title>Iggy's Home Project</title>
<description>dummy</description>
</project>"
)
)

@project.update_all_flags(axml)
assert_equal 0, @project.flags.of_type('build').size
Expand All @@ -482,7 +482,7 @@ def test_store_axml
<url></url>
<disable/>
</project>"
)
)

@project.update_from_xml!(axml)
@project.save!
Expand All @@ -508,7 +508,7 @@ def test_ordering
<arch>x86_64</arch>
</repository>
</project>"
)
)
@project.update_from_xml!(axml)
@project.reload

Expand All @@ -530,7 +530,7 @@ def test_ordering
<arch>local</arch>
</repository>
</project>"
)
)
@project.update_from_xml!(axml)

xml = @project.render_xml
Expand All @@ -552,7 +552,7 @@ def test_maintains
<maintains project='BaseDistro'/>
</maintenance>
</project>"
)
)
@project.update_from_xml!(axml)
@project.reload
xml = @project.render_xml
Expand All @@ -568,7 +568,7 @@ def test_maintains
<maintains project='BaseDistro2.0'/>
</maintenance>
</project>"
)
)
@project.update_from_xml!(axml)
@project.reload
xml = @project.render_xml
Expand All @@ -584,7 +584,7 @@ def test_maintains
<maintains project='BaseDistro2.0'/>
</maintenance>
</project>"
)
)
@project.update_from_xml!(axml)
@project.reload
xml = @project.render_xml
Expand All @@ -598,7 +598,7 @@ def test_maintains
<title>Iggy's Home Project</title>
<description>dummy</description>
</project>"
)
)
@project.update_from_xml!(axml)
@project.reload
xml = @project.render_xml
Expand All @@ -620,7 +620,7 @@ def test_maintains
<arch>i586</arch>
</repository>
</project>"
)
)
assert_raise(ActiveRecord::RecordInvalid) do
Project.transaction do
@project.update_from_xml!(axml)
Expand Down Expand Up @@ -695,7 +695,7 @@ def test_handle_project_links
<description>dummy</description>
<link project='home:Iggy' />
</project>"
)
)
project_a = Project.create( name: "home:Iggy:A" )
project_a.update_from_xml!(axml)
project_a.store
Expand All @@ -707,7 +707,7 @@ def test_handle_project_links
<description>dummy</description>
<link project='home:Iggy:A' />
</project>"
)
)
project_b = Project.create( name: "home:Iggy:B" )
project_b.update_from_xml!(axml)
project_b.store
Expand Down Expand Up @@ -742,8 +742,7 @@ def test_repository_with_download_url
<arch>i586</arch>
</repository>
</project>"
)
)
))

xml = prj.to_axml
assert_xml_tag xml, tag: :download, attributes: {arch: "i586", url: "http://me.org", repotype: "rpmmd"}
Expand Down Expand Up @@ -795,8 +794,7 @@ def test_repository_path_sync
<description/>
<repository name='sp0_ga' />
</project>"
)
)
))
prj = Project.new(name: "Enterprise-SP0:Update")
prj.update_from_xml!( Xmlhash.parse(
"<project name='Enterprise-SP0:Update' kind='maintenance_release'>
Expand All @@ -806,8 +804,7 @@ def test_repository_path_sync
<path project='Enterprise-SP0:GA' repository='sp0_ga' />
</repository>
</project>"
)
)
))
prj = Project.new(name: "Enterprise-SP1:GA")
prj.update_from_xml!( Xmlhash.parse(
"<project name='Enterprise-SP1:GA'>
Expand All @@ -817,8 +814,7 @@ def test_repository_path_sync
<path project='Enterprise-SP0:GA' repository='sp0_ga' />
</repository>
</project>"
)
)
))
prj = Project.new(name: "Enterprise-SP1:Update")
prj.update_from_xml!( Xmlhash.parse(
"<project name='Enterprise-SP1:Update' kind='maintenance_release'>
Expand All @@ -829,8 +825,7 @@ def test_repository_path_sync
<path project='Enterprise-SP0:Update' repository='sp0_update' />
</repository>
</project>"
)
)
))
prj = Project.new(name: "Enterprise-SP1:Channel:Server")
prj.update_from_xml!( Xmlhash.parse(
"<project name='Enterprise-SP1:Channel:Server'>
Expand All @@ -840,8 +835,7 @@ def test_repository_path_sync
<path project='Enterprise-SP1:Update' repository='sp1_update' />
</repository>
</project>"
)
)
))
# this is what the classic add_repository call is producing:
prj = Project.new(name: "My:Branch")
prj.update_from_xml!( Xmlhash.parse(
Expand All @@ -858,8 +852,7 @@ def test_repository_path_sync
<path project='Enterprise-SP1:Update' repository='sp1_update' />
</repository>
</project>"
)
)
))
# however, this is not correct, because my:branch (or an incident)
# is providing in this situation often a package in SP0:Update which
# must be used for building the package in sp1 repo.
Expand Down Expand Up @@ -919,26 +912,29 @@ def test_cycle_handling
User.current = users( :king )

prj_a = Project.new(name: "Project:A")
prj_a.update_from_xml!( Xmlhash.parse(
prj_a.update_from_xml!(Xmlhash.parse(
"<project name='Project:A'>
<title/>
<description/>
</project>") )
</project>"
))
prj_a.save!
prj_b = Project.new(name: "Project:B")
prj_b.update_from_xml!( Xmlhash.parse(
prj_b.update_from_xml!(Xmlhash.parse(
"<project name='Project:B'>
<title/>
<description/>
<link project='Project:A'/>
</project>") )
</project>"
))
prj_b.save!
prj_a.update_from_xml!( Xmlhash.parse(
prj_a.update_from_xml!(Xmlhash.parse(
"<project name='Project:A'>
<title/>
<description/>
<link project='Project:B'/>
</project>") )
</project>"
))
prj_a.save!

assert_equal [], prj_a.expand_all_packages
Expand Down

0 comments on commit b782fad

Please sign in to comment.