<commit_before>require 'fileutils'
require 'set'

module Overcommit::HookContext
  # Contains helpers related to contextual information used by pre-commit hooks.
  #
  # This includes staged files, which lines of those files have been modified,
  # etc. It is also responsible for saving/restoring the state of the repo so
  # hooks only inspect staged changes.
  class RunAll < Base
    # Get a list of added, copied, or modified files that have been staged.
    # Renames and deletions are ignored, since there should be nothing to check.
    def modified_files
      all_files
    end

    # Returns the camel-cased type of this hook (e.g. PreCommit)
    def hook_class_name
      'PreCommit'
    end

    # Returns the snake-cased type of this hook (e.g. pre_commit)
    def hook_type_name
      'pre_commit'
    end

    # Returns the actual name of the hook script being run (e.g. pre-commit).
    def hook_script_name
      'pre-commit'
    end

    private<commit_msg>Clean up RunAll context<commit_after>module Overcommit::HookContext
  # Simulates a pre-commit context pretending that all files have been changed.
  #
  # This results in pre-commit hooks running against the entire repository,
  # which is useful for automated CI scripts.
  class RunAll < Base
    def modified_files
      all_files
    end

    def hook_class_name
      'PreCommit'
    end

    def hook_type_name
      'pre_commit'
    end

    def hook_script_name
      'pre-commit'
    end

    private
{'fraction_non_alphanumeric': 0.051816958277254375, 'fraction_numerical': 0.0, 'mean_word_length': 2.882506527415144, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7043853', 'n_tokens_mistral': 432, 'n_tokens_neox': 418, 'n_words': 173}