提交 dfe03e54 编写于 作者: M masarakki

add rake task to exit with error code when fail

上级 2994bb51
......@@ -7,4 +7,11 @@ namespace :brakeman do
files = args[:output_files].split(' ') if args[:output_files]
Brakeman.run :app_path => ".", :output_files => files, :print_report => true
end
desc "Check your code with Brakeman"
task :check do
require 'brakeman'
result = Brakeman.run app_path: '.', print_report: true
exit Brakeman::Warnings_Found_Exit_Code unless result.filtered_warnings.empty?
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册