Commit fdc17ebc authored by Ash McKenzie's avatar Ash McKenzie

Add new danger_local Rake task

The benefit of running the danger_local Rake task
is that it displays some informational messages
for clarity and also exits with 1 if there's any
output.
parent 75dae7fe
desc 'Run local Danger rules'
task :danger_local do
require 'gitlab_danger'
require_relative '../../lib/gitlab/popen'
puts("#{GitlabDanger.local_warning_message}\n")
# _status will _always_ be 0, regardless of failure or success :(
output, _status = Gitlab::Popen.popen(%w{danger dry_run})
if output.empty?
puts(GitlabDanger.success_message)
else
puts(output)
exit(1)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment