lib/glyptodont/checker.rb in glyptodont-0.2.0 vs lib/glyptodont/checker.rb in glyptodont-0.3.0

- old
+ new

@@ -12,18 +12,24 @@ module Glyptodont # Main class where all the work happens class Checker DEFAULT_THRESHOLD = 10 DEFAULT_MAX_AGE_IN_DAYS = 14 + DEFAULT_KEYWORDS = %w[ + FIXME + HACK + TODO + XXX + ].freeze def initialize(args) @options = Options.new(args) @configuration = Configuration.new(directory) end def check - todos = TodoResearcher.new(directory, ignore).research + todos = TodoResearcher.new(directory, ignore, keywords).research checks = [ Checkers::Counter.new(todos: todos, threshold: threshold), Checkers::Age.new(todos: todos, threshold: max_age_in_days) ].freeze @@ -44,8 +50,12 @@ options.threshold || configuration.threshold || DEFAULT_THRESHOLD end def max_age_in_days options.max_age_in_days || configuration.max_age_in_days || DEFAULT_MAX_AGE_IN_DAYS + end + + def keywords + options.keywords || configuration.keywords || DEFAULT_KEYWORDS end end end