Skip to content

Commit

Permalink
[frontend] Fix Style/CommentAnnotation offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Dec 20, 2017
1 parent 35ac68b commit be463a5
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 34 deletions.
18 changes: 0 additions & 18 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,24 +323,6 @@ Style/ClassVars:
- 'src/api/test/functional/branch_publish_flag_test.rb'
- 'src/api/test/test_helper.rb'

# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: Keywords.
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
Style/CommentAnnotation:
Exclude:
- 'src/api/app/controllers/person_controller.rb'
- 'src/api/app/controllers/search_controller.rb'
- 'src/api/app/controllers/webui/main_controller.rb'
- 'src/api/app/controllers/webui/package_controller.rb'
- 'src/api/app/models/bs_request_action.rb'
- 'src/api/app/models/bs_request_action_group.rb'
- 'src/api/app/models/owner.rb'
- 'src/api/app/models/product.rb'
- 'src/api/test/functional/attributes_test.rb'
- 'src/api/test/functional/build_controller_test.rb'
- 'src/api/test/functional/request_controller_test.rb'

# Offense count: 8
Style/CommentedKeyword:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/person_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def grouplist
end

def register
# FIXME 3.0, to be removed
# FIXME: 3.0, to be removed
internal_register
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def search(what, render_all)
end
relation = relation.includes(includes).references(includes)

# TODO support sort_by and order parameters?
# TODO: support sort_by and order parameters?

relation.each do |item|
next if xml[item.id]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def add_news
flash[:error] = 'Please provide a message and severity'
redirect_to(action: 'index') && return
end
# TODO - make use of permissions.status_message_create
# TODO: make use of permissions.status_message_create
status_message = StatusMessage.new(message: params[:message], severity: params[:severity], user: User.current)
if status_message.save
flash[:notice] = 'Status message was successfully created.'
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def set_file_details

@files = package_files(@srcmd5 || @revision, @expand)
rescue ActiveXML::Transport::Error => e
# TODO crudest hack ever!
# TODO: crudest hack ever!
if e.summary == 'service in progress' && @expand == 1
@expand = 0
@service_running = true
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def check_sanity
errors.add(:target_project, 'is invalid project name') if target_project && !Project.valid_name?(target_project)
errors.add(:source_project, 'is invalid project name') if source_project && !Project.valid_name?(source_project)

# TODO to be continued
# TODO: to be continued
end

def action_type
Expand Down Expand Up @@ -945,7 +945,7 @@ def check_for_expand_errors!(add_revision)
query = {}
query[:expand] = '1' unless updatelink
query[:rev] = source_rev if source_rev
# FIXME we have a Directory model
# FIXME: we have a Directory model
url = Package.source_path(source_project, source_package, nil, query)
c = Backend::Connection.get(url).body
if add_revision && !source_rev
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/bs_request_action_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def set_group_to_new
bs_request.state = :new
bs_requests.each do |req|
next unless req.state == :review
# TODO add history
# TODO: add history
req.state = :new
req.save
end
Expand All @@ -134,7 +134,7 @@ def set_group_to_review
bs_request.state = :review
bs_requests.each do |req|
next if req.state == :review
# TODO add history
# TODO: add history
req.state = :review
req.save
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/owner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def self.find_containers_without_definition(rootproject, devel = true, filter =
distinct.where("projects.kind='maintenance_release' AND (ISNULL(package_kinds.kind) OR package_kinds.kind='patchinfo')").pluck(:name)

if devel == true
# FIXME add devel packages, but how do recursive lookup fast in SQL?
# FIXME: add devel packages, but how do recursive lookup fast in SQL?
end
defined_packages.uniq!

Expand Down Expand Up @@ -224,7 +224,7 @@ def self.find_containers(rootproject, owner, devel = true, filter = %w(maintaine
raise 'illegal object handed to find_containers'
end
if devel == true
# FIXME add devel packages, but how do recursive lookup fast in SQL?
# FIXME: add devel packages, but how do recursive lookup fast in SQL?
end
found_packages = found_packages.pluck(:package_id).uniq
found_projects = found_projects.pluck(:project_id).uniq
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def to_axml(_opts = {})
end

def set_CPE(sw_class, vendor, pversion = nil)
# hack for old SLE 11 definitions
# HACK: for old SLE 11 definitions
vendor = 'suse' if vendor.start_with?('SUSE LINUX')
self.cpe = "cpe:/#{sw_class}:#{vendor.downcase}:#{name.downcase}"
self.cpe += ":#{pversion}" if pversion.present?
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 @@ -512,6 +512,5 @@ def test_create_attributes_package
assert_xml_tag(tag: 'attribute', attributes: { namespace: 'OBS', name: 'Maintained', binary: 'kdelibs-devel' })
end

# FIXME:
# * value based test are missing
# FIXME: value based test are missing
end
2 changes: 1 addition & 1 deletion src/api/test/functional/build_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def test_binary_view

get '/build/home:Iggy/10.2/i586/TestPack/package-1.0-1.i586.rpm?view=fileinfo'
assert_response :success
# FIXME validate xml content
# FIXME: validate xml content
end

def test_read_access_hidden_binary_view
Expand Down
4 changes: 2 additions & 2 deletions src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ def test_search_and_involved_requests
assert_response :success
assert_xml_tag(tag: 'collection', child: { tag: 'request' })
if @ENABLE_BROKEN_TEST
# FIXME there is no code in this test creating request from HiddenProject
# FIXME: there is no code in this test creating request from HiddenProject

assert_xml_tag(tag: 'source', attributes: { project: 'HiddenProject', package: 'pack' })
end
Expand Down Expand Up @@ -2876,7 +2876,7 @@ def test_create_request_to_hidden_package_from_hidden_place_invalid_user
## create request from hidden package to open place - valid user - fail ! ?
def test_create_request_from_hidden_package_to_open_place_valid_user
request_hidden('adrian', 'buildservice', 'request/from_hidden_to_open_valid')
# FIXME !!
# FIXME: !!
# should we really allow this - might be a mistake. qualified procedure could be:
# sr from hidden to hidden and then make new location visible
assert_response :success
Expand Down

0 comments on commit be463a5

Please sign in to comment.