{"record":{"id":"2d3a48196daa0882","repo":"sds/overcommit","slug":"one-or-more-hooks-had-invalid-names","errorCode":null,"errorMessage":"One or more hooks had invalid names","messagePattern":"One or more hooks had invalid names","errorType":"exception","errorClass":"Overcommit::Exceptions::ConfigurationError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/configuration_validator.rb","lineNumber":118,"sourceCode":"\n      Overcommit::Utils.supported_hook_type_classes.each do |hook_type|\n        hash.fetch(hook_type) { {} }.each_key do |hook_name|\n          next if hook_name == 'ALL'\n\n          unless hook_name.match?(/\\A[A-Za-z0-9]+\\z/)\n            errors << \"#{hook_type}::#{hook_name} has an invalid name \" \\\n                      \"#{hook_name}. It must contain only alphanumeric \" \\\n                      'characters (no underscores or dashes, etc.)'\n          end\n        end\n      end\n\n      if errors.any?\n        if @log\n          @log.error errors.join(\"\\n\")\n          @log.newline\n        end\n        raise Overcommit::Exceptions::ConfigurationError,\n              'One or more hooks had invalid names'\n      end\n    end\n\n    # Prints a warning if there are any hooks listed in the configuration\n    # without `enabled` explicitly set.\n    def check_for_missing_enabled_option(hash)\n      return unless @log\n\n      any_warnings = false\n\n      Overcommit::Utils.supported_hook_type_classes.each do |hook_type|\n        hash.fetch(hook_type) { {} }.each do |hook_name, hook_config|\n          next if hook_name == 'ALL'\n\n          if hook_config['enabled'].nil?\n            @log.warning \"#{hook_type}::#{hook_name} hook does not explicitly \" \\\n                         'set `enabled` option in .overcommit.yml'","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/configuration_validator.rb#L100-L136","documentation":"Error \"One or more hooks had invalid names\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/configuration_validator.rb:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename hook entries in .overcommit.yml so names contain only alphanumeric characters (no underscores or dashes), e.g. `RuboCop`, `TrailingWhitespace`.","Check the error lines printed above the message; they list each invalid hook name.","Remove any hook entries that are not real built-in or plugin hooks."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fee0cd74b26eb81f64b43b7fab17bbb541575cc4","analyzedAt":"2026-08-23T04:07:28.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}