{"record":{"id":"fb1b3856b7598e2b","repo":"golangci/golangci-lint","slug":"s-is-not-a-formatter","errorCode":null,"errorMessage":"%s is not a formatter","messagePattern":"(.+?) is not a formatter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/formatters.go","lineNumber":17,"sourceCode":"package config\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n)\n\ntype Formatters struct {\n\tEnable     []string            `mapstructure:\"enable\"`\n\tSettings   FormatterSettings   `mapstructure:\"settings\"`\n\tExclusions FormatterExclusions `mapstructure:\"exclusions\"`\n}\n\nfunc (f *Formatters) Validate() error {\n\tfor _, n := range f.Enable {\n\t\tif !slices.Contains(getAllFormatterNames(), n) {\n\t\t\treturn fmt.Errorf(\"%s is not a formatter\", n)\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype FormatterExclusions struct {\n\tGenerated  string   `mapstructure:\"generated\"`\n\tPaths      []string `mapstructure:\"paths\"`\n\tWarnUnused bool     `mapstructure:\"warn-unused\"`\n}\n","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/config/formatters.go#L1-L29","documentation":"Formatters.Validate checks each name in formatters.enable against the registry of known formatter names (e.g. gofmt, gofumpt, goimports). Any unknown name produces this error. It catches misspelled or non-formatter tools configured in the formatters section.","triggerScenarios":"Config file containing formatters.enable: [xyz] where xyz is not a registered formatter name (typo, removed formatter, or a linter placed in the formatters section).","commonSituations":"Typing 'gofmpt' instead of 'gofumpt'; migrating from v1 where some tools were linters; using a custom/plugin linter name under formatters.","solutions":["Correct the name in formatters.enable to a valid formatter (gofmt, gofmt, goimports, gofumpt, golines, etc.)","Run 'golangci-lint formatters' to list valid formatter names","Move the entry to linters.enable if it is actually a linter, not a formatter"],"exampleFix":"# before\nformatters:\n  enable:\n    - gofmpt\n# after\nformatters:\n  enable:\n    - gofumpt","handlingStrategy":"validation","validationCode":"var knownFormatters = []string{\"gofmt\",\"goimports\",\"gofumpt\",\"golines\",\"swaggo\",\"gci\"}\nfor _, n := range cfg.Formatters.Enable {\n\tif !slices.Contains(knownFormatters, n) {\n\t\treturn fmt.Errorf(\"%s is not a formatter\", n)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := formatters.Validate(); err != nil { log.Fatalf(\"formatter config: %v\", err) }","preventionTips":["Run 'golangci-lint formatters' to list valid names before editing config","Keep formatter names in formatters.enable, linter names in linters.enable","Verify config in CI with 'golangci-lint config verify'"],"tags":["golangci-lint","config-validation","formatters"],"backgroundTag":"unknown-formatter-name","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}