def hook_path
      @hook_path ||= begin
        plugin_path = File.join(@config.plugin_directory,
                                @context.hook_type_name,
                                "#{Overcommit::Utils.snake_case(@hook_name)}.rb")

        if File.exist?(plugin_path)
          plugin_path
        else
          # Otherwise this is an ad hoc hook using an existing hook script
          hook_config = @config.for_hook(@hook_name, @context.hook_class_name)

          command = Array(hook_config['command'] || hook_config['required_executable'])

          if @config.verify_signatures? &&
            signable_file?(command.first) &&
            !Overcommit::GitRepo.tracked?(command.first)
            raise Overcommit::Exceptions::InvalidHookDefinition,
                  'Hook specified a `required_executable` or `command` that ' \
                  'is a path relative to the root of the repository, and so ' \
                  'must be tracked by Git in order to be signed'
          end

          File.join(Overcommit::Utils.repo_root, command.first.to_s)
        end
      end
    end
def hook_path
      @hook_path ||= begin
        plugin_path = File.join(@config.plugin_directory,
                                @context.hook_type_name,
                                "#{Overcommit::Utils.snake_case(@hook_name)}.rb")

        if File.exist?(plugin_path)
          plugin_path
        else
          # Otherwise this is an ad hoc hook using an existing hook script
          hook_config = @config.for_hook(@hook_name, @context.hook_class_name)

          command = Array(hook_config['command'] || hook_config['required_executable'])

          if @config.verify_signatures? &&
            signable_file?(command.first) &&
            !Overcommit::GitRepo.tracked?(command.first)
            raise Overcommit::Exceptions::InvalidHookDefinition,
                  'Hook specified a `required_executable` or `command` that ' \
                  'is a path relative to the root of the repository, and so ' \
                  'must be tracked by Git in order to be signed'
          end

          File.join(Overcommit::Utils.repo_root, command.first.to_s)
        end
      end
    end
@param hook_name [String] name of the hook
 @param config [Overcommit::Configuration]
 @param context [Overcommit::HookContext]
 Returns the path of the file that should be incorporated into this hooks
 signature.

 @return [String]