lib/inspec/cli.rb in inspec-4.7.3 vs lib/inspec/cli.rb in inspec-4.7.18
- old
+ new
@@ -122,11 +122,11 @@
if o["format"] == "json"
puts JSON.generate(result)
else
%w{location profile controls timestamp valid}.each do |item|
puts format("%-12s %s", item.to_s.capitalize + ":",
- mark_text(result[:summary][item.to_sym]))
+ mark_text(result[:summary][item.to_sym]))
end
puts
if result[:errors].empty? && result[:warnings].empty?
puts "No errors or warnings"
@@ -146,12 +146,12 @@
puts "#{yellow} ! #{item_msg.call(item)}#{rst}"
end
puts
puts format("Summary: %s%d errors%s, %s%d warnings%s",
- red, result[:errors].length, rst,
- yellow, result[:warnings].length, rst)
+ red, result[:errors].length, rst,
+ yellow, result[:warnings].length, rst)
end
end
exit 1 unless result[:summary][:valid]
rescue StandardError => e
pretty_handle_exception(e)
@@ -373,11 +373,11 @@
require "inspec/schema"
puts Inspec::Schema.json(name)
rescue StandardError => e
puts e
- puts "Valid schemas are #{Inspec::Schema.names.join(', ')}"
+ puts "Valid schemas are #{Inspec::Schema.names.join(", ")}"
end
desc "version", "prints the version of this tool"
option :format, type: :string
def version
@@ -408,9 +408,10 @@
runner = Inspec::Runner.new(Inspec::Config.new(opts))
res = runner.eval_with_virtual_profile(opts[:command])
runner.load
return :ruby_eval, res if runner.all_rules.empty?
+
return :rspec_run, runner.run_tests # rubocop:disable Style/RedundantReturn
end
end
#=====================================================================#