{"record":{"id":"272cf2547705f057","repo":"d12frosted/homebrew-emacs-plus","slug":"unknown-configuration-key-s-in-path-unknown","errorCode":null,"errorMessage":"Unknown configuration key(s) in #{path}: #{unknown_keys.join(', ')}\nValid keys are: #{ALL_KEYS.join(', ')}#{suggestion_text}","messagePattern":"Unknown configuration key\\(s\\) in #(.+?): #(.+?)\nValid keys are: #(.+?)#(.+?)","errorType":"validation","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"Library/BuildConfig.rb","lineNumber":171,"sourceCode":"    # Validate that config has the expected structure\n    def validate_config!(config, path)\n      unless config.is_a?(Hash)\n        raise ConfigurationError,\n          \"Invalid build.yml at #{path}\\n\" \\\n          \"Expected a YAML mapping (key: value pairs), but got: #{config.class}\\n\" \\\n          \"Content: #{config.inspect[0..100]}\\n\\n\" \\\n          \"Common causes:\\n\" \\\n          \"  - Missing space after colon (use 'icon: value' not 'icon:value')\\n\" \\\n          \"  - File contains only a string instead of key-value pairs\"\n      end\n\n      # Check for unknown keys\n      unknown_keys = config.keys - ALL_KEYS\n      unless unknown_keys.empty?\n        suggestions = unknown_keys.map { |k| suggest_key(k) }.compact\n        suggestion_text = suggestions.empty? ? \"\" : \"\\n\\nDid you mean:\\n#{suggestions.map { |s| \"  - #{s}\" }.join(\"\\n\")}\"\n\n        raise ConfigurationError,\n          \"Unknown configuration key(s) in #{path}: #{unknown_keys.join(', ')}\\n\" \\\n          \"Valid keys are: #{ALL_KEYS.join(', ')}#{suggestion_text}\"\n      end\n\n      # Validate individual keys\n      validate_icon!(config[\"icon\"], path) if config.key?(\"icon\")\n      validate_patches!(config[\"patches\"], path) if config.key?(\"patches\")\n      validate_revision!(config[\"revision\"], path) if config.key?(\"revision\")\n      validate_inject_path!(config[\"inject_path\"], path) if config.key?(\"inject_path\")\n    end\n\n    # Suggest correct key name for typos\n    def suggest_key(unknown_key)\n      ALL_KEYS.find do |valid_key|\n        # Simple similarity: same first letter or Levenshtein distance <= 2\n        unknown_key[0]&.downcase == valid_key[0] ||\n          levenshtein_distance(unknown_key.downcase, valid_key) <= 2\n      end&.then { |key| \"'#{unknown_key}' -> '#{key}'\" }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/d12frosted/homebrew-emacs-plus/blob/01c47fe98f35ff28a37a89e1f7aafadff621f9e0/Library/BuildConfig.rb#L153-L189","documentation":"The top-level mapping contains keys outside ALL_KEYS - exactly `icon`, `patches`, `revision`, `inject_path` (the union of FORMULA_KEYS and CASK_KEYS, Library/BuildConfig.rb:15-17). validate_config! computes `config.keys - ALL_KEYS` (line 166) and aborts listing every unknown key, the valid set, and a 'Did you mean' line generated by suggest_key (first-letter match or Levenshtein distance <= 2, lines 184-190). Unknown keys are rejected rather than silently ignored - this tap treats ignored config as a defect.","triggerScenarios":"Any top-level key not in {icon, patches, revision, inject_path}: typos like `icons:`, `icno:`, `patch:`; Ruby-style symbol keys (`:icon: X` parses to a Symbol and does not match the String set); stale keys from older tap releases; or settings from other tools (`env:`, `options:`, `flags:`). Only top-level keys are checked here - shapes nested inside `icon:` are checked by the icon validators.","commonSituations":"Key renames across emacs-plus releases (a config that worked before `brew update` fails after); users translating old `--with-*` brew command-line flags into build.yml and inventing key names; copying config from a different Emacs distribution's docs; plain hand-editing typos.","solutions":["Rename the unknown key(s) to a valid one - icon, patches, revision, or inject_path - as listed in the message itself.","Check the 'Did you mean' line first: for typos within edit distance 2 (e.g. `icons` -> `icon`) it gives the exact correction.","Delete keys this tap never supported; they had no effect anyway.","Run `brew update && brew info emacs-plus` to confirm the current key names for your tap version, then re-edit the file."],"exampleFix":"# before\nicons: Spacemacs\n\n# after\nicon: Spacemacs","handlingStrategy":"validation","validationCode":"VALID_KEYS = %w[icon patches revision inject_path].freeze\nunknown = config_hash.keys.map(&:to_s) - VALID_KEYS\nabort \"Unknown build.yml key(s): #{unknown.join(', ')}; valid: #{VALID_KEYS.join(', ')}\" unless unknown.empty?","typeGuard":"def known_build_keys?(config)\n  (config.keys - %w[icon patches revision inject_path]).empty?\nend","tryCatchPattern":"begin\n  BuildConfig.load_config\nrescue BuildConfig::ConfigurationError => e\n  abort \"Fix these keys, then retry: #{e.message}\" if e.message.start_with?(\"Unknown configuration key\")\n  raise\nend","preventionTips":["Keep your working build.yml in version-controlled dotfiles instead of editing it ad hoc","Re-check valid keys after `brew update` - the tap occasionally reshapes its config surface","Treat the 'Did you mean' line in the error as authoritative for typos","Do not translate brew command-line flags into YAML keys; only the four documented keys exist"],"tags":["configuration","validation","typo","emacs-plus","homebrew"],"backgroundTag":"unknown-config-key","analyzedSha":"01c47fe98f35ff28a37a89e1f7aafadff621f9e0","analyzedAt":"2026-08-23T16:25:45.065Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}