lib/overcommit/configuration_validator.rb
# Validates hash for any invalid options, normalizing where possible.
#
# @param config [Overcommit::Configuration]
# @param hash [Hash] hash representation of YAML config
# @param options[Hash]
# @option default [Boolean] whether hash represents the default built-in config
# @option logger [Overcommit::Logger] logger to output warnings to
# @return [Hash] validated hash (potentially modified)
Validates hash for any invalid options, normalizing where possible.
Validates hash for any invalid options normalizing where possible .
def validate(config, hash, options)
      @options = options.dup
      @log = options[:logger]
      hash = convert_nils_to_empty_hashes(hash)
      ensure_hook_type_sections_exist(hash)
      check_hook_name_format(hash)
      check_hook_env(hash)
      check_for_missing_enabled_option(hash) unless @options[:default]
      check_for_too_many_processors(config, hash)
      check_for_verify_plugin_signatures_option(hash)
      hash
    end
def validate ( config , hash , options ) @options = options . dup @log = options [ :logger ] hash = convert_nils_to_empty_hashes ( hash ) ensure_hook_type_sections_exist ( hash ) check_hook_name_format ( hash ) check_hook_env ( hash ) check_for_missing_enabled_option ( hash ) unless @options [ :default ] check_for_too_many_processors ( config , hash ) check_for_verify_plugin_signatures_option ( hash ) hash end
Validates hash for any invalid options, normalizing where possible.
Validates hash for any invalid options normalizing where possible .
validated hash (potentially modified)
validated hash ( potentially modified )
Hash
config
<not_specific>
hash
hash representation of YAML config
hash representation of YAML config
options
<not_specific>
<not_specific>
None
default
<not_specific>
whether hash represents the default built-in config
whether hash represents the default built - in config
logger
<not_specific>
logger to output warnings to
logger to output warnings to