lib/inspec/profile.rb in inspec-0.26.0 vs lib/inspec/profile.rb in inspec-0.27.0
- old
+ new
@@ -143,10 +143,11 @@
@logger.info("Found #{count} controls.")
end
# iterate over hash of groups
params[:controls].each { |id, control|
- sfile, sline = control[:source_location]
+ sfile = control[:source_location][:ref]
+ sline = control[:source_location][:line]
error.call(sfile, sline, nil, id, 'Avoid controls with empty IDs') if id.nil? or id.empty?
next if id.start_with? '(generated '
warn.call(sfile, sline, nil, id, "Control #{id} has no title") if control[:title].to_s.empty?
warn.call(sfile, sline, nil, id, "Control #{id} has no description") if control[:desc].to_s.empty?
warn.call(sfile, sline, nil, id, "Control #{id} has impact > 1.0") if control[:impact].to_f > 1.0