diff options
Diffstat (limited to 'danger/plugins/todos.rb')
-rw-r--r-- | danger/plugins/todos.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/danger/plugins/todos.rb b/danger/plugins/todos.rb index b31f147f2af..06b76321f95 100644 --- a/danger/plugins/todos.rb +++ b/danger/plugins/todos.rb @@ -5,7 +5,11 @@ require_relative '../../tooling/danger/outdated_todo' module Danger class Todos < ::Danger::Plugin def check_outdated_todos(filenames) - Tooling::Danger::OutdatedTodo.new(filenames, context: self).check + Tooling::Danger::OutdatedTodo.new(filenames, context: self, allow_fail: from_lefthook?).check + end + + def from_lefthook? + %w[1 true].include?(ENV['FROM_LEFTHOOK']) end end end |