{"record":{"id":"8cbceede9dc76d49","repo":"golangci/golangci-lint","slug":"custom-linter-q-w","errorCode":null,"errorMessage":"custom linter %q: %w","messagePattern":"custom linter %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/linters_settings.go","lineNumber":355,"sourceCode":"\tUseStdlibVars            UseStdlibVarsSettings            `mapstructure:\"usestdlibvars\"`\n\tUseTesting               UseTestingSettings               `mapstructure:\"usetesting\"`\n\tVarnamelen               VarnamelenSettings               `mapstructure:\"varnamelen\"`\n\tWhitespace               WhitespaceSettings               `mapstructure:\"whitespace\"`\n\tWrapcheck                WrapcheckSettings                `mapstructure:\"wrapcheck\"`\n\tWSL                      WSLv4Settings                    `mapstructure:\"wsl\"` // Deprecated: use WSLv5 instead.\n\tWSLv5                    WSLv5Settings                    `mapstructure:\"wsl_v5\"`\n\n\tCustom map[string]CustomLinterSettings `mapstructure:\"custom\"`\n}\n\nfunc (s *LintersSettings) Validate() error {\n\tif err := s.Govet.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tfor name, settings := range s.Custom {\n\t\tif err := settings.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"custom linter %q: %w\", name, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype AsasalintSettings struct {\n\tExclude              []string `mapstructure:\"exclude\"`\n\tUseBuiltinExclusions bool     `mapstructure:\"use-builtin-exclusions\"`\n}\n\ntype BiDiChkSettings struct {\n\tLeftToRightEmbedding     bool `mapstructure:\"left-to-right-embedding\"`\n\tRightToLeftEmbedding     bool `mapstructure:\"right-to-left-embedding\"`\n\tPopDirectionalFormatting bool `mapstructure:\"pop-directional-formatting\"`\n\tLeftToRightOverride      bool `mapstructure:\"left-to-right-override\"`\n\tRightToLeftOverride      bool `mapstructure:\"right-to-left-override\"`\n\tLeftToRightIsolate       bool `mapstructure:\"left-to-right-isolate\"`","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/config/linters_settings.go#L337-L373","documentation":"During LintersSettings validation, each entry in settings.custom is validated; a failure is wrapped as 'custom linter %q: %w' with the plugin's name. This means a user-defined (plugin) linter's settings block — typically its path and type — is invalid.","triggerScenarios":"Config linters.settings.custom.<name> missing required fields (e.g. no 'path' to the plugin .so, bad 'type'), or the referenced plugin file failing the inner validation.","commonSituations":"Custom plugin path typo or .so not built; using module plugin type without a valid module path; upgrading plugins after golangci-lint version change.","solutions":["Read the wrapped inner error for the exact field problem on the named custom linter","Set the required keys (path and type) in linters.settings.custom.<name>","Rebuild the plugin .so with the matching golangci-lint version and fix the path"],"exampleFix":"# before\nlinters:\n  settings:\n    custom:\n      mylinter:\n        type: module\n# after\nlinters:\n  settings:\n    custom:\n      mylinter:\n        path: ./plugin/mylinter.so\n        type: plugin","handlingStrategy":"validation","validationCode":"for name, s := range cfg.Linters.Settings.Custom {\n\tif s.Path == \"\" {\n\t\treturn fmt.Errorf(\"custom linter %q: path is required\", name)\n\t}\n\tif _, err := os.Stat(s.Path); err != nil {\n\t\treturn fmt.Errorf(\"custom linter %q: plugin not found: %w\", name, err)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := settings.Validate(); err != nil {\n\tlog.Fatalf(\"custom linter config: %v\", err)\n}","preventionTips":["Always set both path and type for custom linters","Build plugin .so files with the exact golangci-lint version in use","Check plugin paths are relative to config dir or absolute as documented"],"tags":["golangci-lint","config-validation","plugins"],"backgroundTag":"invalid-plugin-settings","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}