Class: Jekyll::PreCommit::Checks::NoTodos

Inherits:
Check
  • Object
show all
Defined in:
lib/jekyll-pre-commit/checks/no_todos.rb

Instance Method Summary collapse

Methods inherited from Check

#initialize

Constructor Details

This class inherits a constructor from Jekyll::PreCommit::Checks::Check

Instance Method Details

#check(staged, not_staged, site, args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/jekyll-pre-commit/checks/no_todos.rb', line 5

def check(staged, not_staged, site, args)
  staged.each do |post|
    if post.to_s.downcase.include? 'todo'
      @result[:ok] = false
      @result[:message] += "A todo was found in #{post.data["title"]}. "
    end
  end

  @result
end