{"record":{"id":"2708d8968ed209b2","repo":"argoproj/argo-workflows","slug":"unknown-formatter-s","errorCode":null,"errorMessage":"unknown formatter: %s","messagePattern":"unknown formatter: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/lint/lint.go","lineNumber":76,"sourceCode":"\ntype Formatter interface {\n\tFormat(*Result) string\n\tSummarize(*Results) string\n}\n\nvar (\n\tdefaultFormatter = formatterPretty{}\n\n\tformatters = map[string]Formatter{\n\t\t\"pretty\": formatterPretty{},\n\t\t\"simple\": formatterSimple{},\n\t}\n)\n\nfunc GetFormatter(fmtr string) (Formatter, error) {\n\tf, exists := formatters[fmtr]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"unknown formatter: %s\", fmtr)\n\t}\n\treturn f, nil\n}\n\n// RunLint lints the specified kinds in the specified files and prints the results to os.Stdout.\n// If linting fails it will exit with status code 1.\nfunc RunLint(ctx context.Context, client apiclient.Client, kinds []string, output string, offline bool, opts Options) error {\n\tfmtr, err := GetFormatter(output)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclients, err := getLintClients(ctx, client, kinds)\n\tif err != nil {\n\t\treturn err\n\t}\n\topts.ServiceClients = clients\n\topts.Formatter = fmtr\n\tres, err := Lint(ctx, &opts)","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/lint/lint.go#L58-L94","documentation":"`argo lint --output` accepts only two formatters, registered in the formatters map: `pretty` (default) and `simple`. GetFormatter looks up the requested name and returns `unknown formatter: %s` for anything else. This is a strict allowlist of lint output styles — it does not support json/yaml like some other argo commands.","triggerScenarios":"Running `argo lint --output json my-wf.yaml` or `-o yaml`; scripts reusing the --output value intended for `argo wf list`; calling lint.GetFormatter programmatically with a typo like \"pretty-print\".","commonSituations":"Users expecting JSON lint output for CI parsing; copy-pasted flags between argo subcommands with different output options; typos such as `--output prety`.","solutions":["Use `--output pretty` (default) or `--output simple`.","For machine-readable lint results, capture the `simple` format or lint via the offline API client and parse the returned Results struct.","Run `argo lint --help` to see supported output values."],"exampleFix":"// before\nargo lint --output json workflow.yaml\n// after\nargo lint --output simple workflow.yaml","handlingStrategy":"validation","validationCode":"func validLintFormatter(o string) bool { return o == \"pretty\" || o == \"simple\" }","typeGuard":null,"tryCatchPattern":"fmtr, err := lint.GetFormatter(output)\nif err != nil { return fmt.Errorf(\"supported: pretty, simple; got %q\", output) }","preventionTips":["Only use --output pretty or --output simple with argo lint","Do not copy --output values between argo subcommands; each has its own allowlist","For CI-parsable output, use simple format or drive lint programmatically via lint.Lint()"],"tags":["cli","lint","flag-validation","output-format"],"backgroundTag":"invalid-flag-value","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}