simplify result value from profile check

This commit is contained in:
Christoph Hartmann 2016-02-04 16:47:33 +01:00
parent 7e19c5eec6
commit 14a3100e41
2 changed files with 6 additions and 3 deletions

View file

@ -82,7 +82,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
# run check
profile = Inspec::Profile.from_path(path, o)
success, result = profile.check
result = profile.check
if opts['format'] == 'json'
puts JSON.generate(result)
@ -101,7 +101,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
newline
}
end
exit 1 unless success
exit 1 unless result[:summary][:valid]
end
desc 'archive PATH', 'archive a profile to tar.gz (default) or zip'

View file

@ -162,8 +162,11 @@ module Inspec
}
}
# profile is valid if we could not find any error
result[:summary][:valid] = result[:errors].empty?
@logger.info 'Control definitions OK.' if result[:warnings].empty?
[result[:errors].empty?, result]
result
end
def rules_count