Welcome to mirror list, hosted at ThFree Co, Russian Federation.

todos.rb « plugins « danger - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 06b76321f9597257ac9f42a2af4b9498df76a414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require_relative '../../tooling/danger/outdated_todo'

module Danger
  class Todos < ::Danger::Plugin
    def check_outdated_todos(filenames)
      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