<commit_before>require_relative 'mdspell/version'
require_relative 'mdspell/cli'
require_relative 'mdspell/configuration'
require_relative 'mdspell/spell_checker'
require_relative 'mdspell/text_line'
require_relative 'mdspell/typo'

require 'rainbow'

# This module holds all the MdSpell code (except mdspell shell command).
module MdSpell
  def self.run
    cli = MdSpell::CLI.new
    cli.run

    # Spell-check each file.
    cli.files.each do |filename|
      verbose "Spell-checking #{filename}..."

      spell_checker = SpellChecker.new(filename)

      spell_checker.typos.each do |typo|
        error "#{spell_checker.filename}:#{typo.line.location}: #{typo.word}"
      end
    end
  end

  # Private class methods

  def self.verbose(str)
    puts str if Configuration[:verbose]
  end
  private_class_method :verbose

  def self.error(str)
    puts Rainbow(str).red
  end
  private_class_method :error
end<commit_msg>Display verbose messages after reading from stdin.<commit_after>require_relative 'mdspell/version'
require_relative 'mdspell/cli'
require_relative 'mdspell/configuration'
require_relative 'mdspell/spell_checker'
require_relative 'mdspell/text_line'
require_relative 'mdspell/typo'

require 'rainbow'

# This module holds all the MdSpell code (except mdspell shell command).
module MdSpell
  def self.run
    cli = MdSpell::CLI.new
    cli.run

    # Spell-check each file.
    cli.files.each do |filename|
      spell_checker = SpellChecker.new(filename)

      verbose "Spell-checking #{spell_checker.filename}..."

      spell_checker.typos.each do |typo|
        error "#{spell_checker.filename}:#{typo.line.location}: #{typo.word}"
      end
    end
  end

  # Private class methods

  def self.verbose(str)
    puts str if Configuration[:verbose]
  end
  private_class_method :verbose

  def self.error(str)
    puts Rainbow(str).red
  end
  private_class_method :error
end
{'fraction_non_alphanumeric': 0.09448818897637795, 'fraction_numerical': 0.0, 'mean_word_length': 3.8997429305912594, 'pattern_counts': {'":': 0, '<': 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': '567272', 'n_tokens_mistral': 624, 'n_tokens_neox': 629, 'n_words': 149}