{"record":{"id":"86b240a51ef4fb69","repo":"projectlombok/lombok","slug":"unknown-format-key-s","errorCode":null,"errorMessage":"Unknown format key: '%s'.","messagePattern":"Unknown format key: '(.+?)'\\.","errorType":"console","errorClass":"InvalidFormatOptionException","httpStatus":null,"severity":"error","filePath":"src/delombok/lombok/delombok/Delombok.java","lineNumber":481,"sourceCode":"\t\t\tint idx = format.indexOf(':');\n\t\t\tif (idx == -1) {\n\t\t\t\tif (format.equalsIgnoreCase(\"pretty\")) {\n\t\t\t\t\tprettyEnabled = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new InvalidFormatOptionException(\"Format keys need to be 2 values separated with a colon.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tString key = format.substring(0, idx);\n\t\t\tString value = format.substring(idx + 1);\n\t\t\tboolean valid = false;\n\t\t\tfor (String k : FormatPreferences.getKeysAndDescriptions().keySet()) {\n\t\t\t\tif (k.equalsIgnoreCase(key)) {\n\t\t\t\t\tvalid = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!valid) throw new InvalidFormatOptionException(\"Unknown format key: '\" + key + \"'.\");\n\t\t\tformatPrefs.put(key.toLowerCase(), value);\n\t\t}\n\t\t\n\t\tif (prettyEnabled) {\n\t\t\tif (!formatPrefs.containsKey(\"suppresswarnings\")) formatPrefs.put(\"suppresswarnings\", \"skip\");\n\t\t\tif (!formatPrefs.containsKey(\"generated\")) formatPrefs.put(\"generated\", \"skip\");\n\t\t\tif (!formatPrefs.containsKey(\"dancearoundidechecks\")) formatPrefs.put(\"dancearoundidechecks\", \"skip\");\n\t\t\tif (!formatPrefs.containsKey(\"generatedelombokcomment\")) formatPrefs.put(\"generatedelombokcomment\", \"skip\");\n\t\t\tif (!formatPrefs.containsKey(\"javalangasfqn\")) formatPrefs.put(\"javalangasfqn\", \"skip\");\n\t\t}\n\t\t\n\t\treturn formatPrefs;\n\t}\n\t\n\tpublic void setFormatPreferences(Map<String, String> prefs) {\n\t\tthis.formatPrefs = prefs;\n\t}\n\t","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/delombok/lombok/delombok/Delombok.java#L463-L499","documentation":"After splitting a --format option on ':', formatOptionsToMap validates the key against FormatPreferences.getKeysAndDescriptions(). If the key does not case-insensitively match any known format key, it throws InvalidFormatOptionException(\"Unknown format key: '%s'.\").","triggerScenarios":"Passing -f unknownkey:value where unknownkey is not one of the supported format keys (typo, renamed key, or a key from a different tool), e.g. -f tabwidth:4 instead of the supported indentation key.","commonSituations":"Typos in format keys, remembering keys from lombok versions where they were renamed, confusing delombok format keys with lombok.config keys, or guessing key names from documentation of another version.","solutions":["Check the exact key list via FormatPreferences.getKeysAndDescriptions() or delombok --help and correct the spelling","Use --format pretty as a shortcut for common preferences","Pin documentation/tooling to your lombok version, since available format keys can change between releases"],"exampleFix":"// before\ndelombok src -d out -f tabwidth:4\n// after\ndelombok src -d out -f indent:4","handlingStrategy":"validation","validationCode":"Set<String> keys = FormatPreferences.getKeysAndDescriptions().keySet();\nString k = opt.substring(0, opt.indexOf(':'));\nboolean ok = keys.stream().anyMatch(k::equalsIgnoreCase);\nif (!ok) throw new IllegalArgumentException(\"Unknown format key: \" + k + \"; valid: \" + keys);","typeGuard":null,"tryCatchPattern":"try { delombok.formatOptionsToMap(opts); } catch (InvalidFormatOptionException e) { System.err.println(e.getMessage() + \" Run with --help for valid keys\"); System.exit(2); }","preventionTips":["Verify key names against your lombok version's documentation","Tab-complete or copy key names instead of retyping","Remember config keys and delombok --format keys are separate namespaces"],"tags":["delombok","cli","format-options"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}