<commit_before>module TodoLint
  # We want to be able to report to users about the todos in their code, and
  # the TodoReporter is responsible for passing judgment and generating output
  class TodoReporter
    # Accept a todo and a path to check for problems
    # @example
    #   TodoReporter.new(todo, path: "/Users/max/src/required_arg/README.md")
    # @api public
    def initialize(todo, path: RequiredArg.new(:path))
      @todo = todo
      @path = path
    end

    # Generate the output to show the user about their todo
    # @example
    #   reporter.report
    # @return [String] if the todo is problematic
    # @return [NilClass] if the todo is fine
    # @api public
    def report
      return unless problematic?

      "#{problem_location} #{problem}\n" \
      "#{todo.line}\n" \
      "#{spaces}#{carets}"
    end

    private

    # The todo being reported on
    # @return [Todo]
    # @api private
    attr_reader :todo

    # The path to the file containing the todo
    # @return [String]
    # @api private
    attr_reader :path

    # Whether we need to report on this todo or not
    # @return [Boolean]
    # @api private
    def problematic?
      !todo.annotated?
    end

    def problem_location
      Rainbow(path).green + ":#{todo.line_number}:#{todo.character_number}"
    end

    # The reason we are reporting on this todo
    # @return [String]
    # @api private
    def problem
      Rainbow("Missing due date annotation").red
    end

    # Generate the indentation before the carets
    # @return [String]
    # @api private
    def spaces
      " " * (todo.character_number - 1)
    end

    # Generate the ^^^^ characters to point at the flag
    # @return [String]
    # @api private
    def carets
      "^" * (todo.flag.length)
    end
  end
end
<commit_msg>add missing documentation for new method<commit_after>module TodoLint
  # We want to be able to report to users about the todos in their code, and
  # the TodoReporter is responsible for passing judgment and generating output
  class TodoReporter
    # Accept a todo and a path to check for problems
    # @example
    #   TodoReporter.new(todo, path: "/Users/max/src/required_arg/README.md")
    # @api public
    def initialize(todo, path: RequiredArg.new(:path))
      @todo = todo
      @path = path
    end

    # Generate the output to show the user about their todo
    # @example
    #   reporter.report
    # @return [String] if the todo is problematic
    # @return [NilClass] if the todo is fine
    # @api public
    def report
      return unless problematic?

      "#{todo_location} #{problem}\n" \
      "#{todo.line}\n" \
      "#{spaces}#{carets}"
    end

    private

    # The todo being reported on
    # @return [Todo]
    # @api private
    attr_reader :todo

    # The path to the file containing the todo
    # @return [String]
    # @api private
    attr_reader :path

    # Whether we need to report on this todo or not
    # @return [Boolean]
    # @api private
    def problematic?
      !todo.annotated?
    end

    # Which file, line, and character can the todo be found at?
    # @return [String]
    # @api private
    def todo_location
      Rainbow(path).green + ":#{todo.line_number}:#{todo.character_number}"
    end

    # The reason we are reporting on this todo
    # @return [String]
    # @api private
    def problem
      Rainbow("Missing due date annotation").red
    end

    # Generate the indentation before the carets
    # @return [String]
    # @api private
    def spaces
      " " * (todo.character_number - 1)
    end

    # Generate the ^^^^ characters to point at the flag
    # @return [String]
    # @api private
    def carets
      "^" * (todo.flag.length)
    end
  end
end

{'fraction_non_alphanumeric': 0.0918067787563384, 'fraction_numerical': 0.0005337603416066186, 'mean_word_length': 2.438532110091743, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '495980', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1137, 'n_words': 408}