{"record":{"id":"7d3d54b7c3828b2a","repo":"golangci/golangci-lint","slug":"linter-failed-to-run-w","errorCode":null,"errorMessage":"linter failed to run: %w","messagePattern":"linter failed to run: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/nolintlint/nolintlint.go","lineNumber":45,"sourceCode":"\t\tneeds |= nolintlint.NeedsSpecific\n\t}\n\tif !settings.AllowUnused {\n\t\tneeds |= nolintlint.NeedsUnused\n\t}\n\n\tlnt, err := nolintlint.NewLinter(needs, settings.AllowNoExplanation)\n\tif err != nil {\n\t\tinternal.LinterLogger.Fatalf(\"%s: create analyzer: %v\", nolintlint.LinterName, err)\n\t}\n\n\treturn goanalysis.\n\t\tNewLinterFromAnalyzer(&analysis.Analyzer{\n\t\t\tName: nolintlint.LinterName,\n\t\t\tDoc:  \"Reports ill-formed or insufficient nolint directives\",\n\t\t\tRun: func(pass *analysis.Pass) (any, error) {\n\t\t\t\tissues, err := lnt.Run(pass)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"linter failed to run: %w\", err)\n\t\t\t\t}\n\n\t\t\t\tif len(issues) == 0 {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\n\t\t\t\tmu.Lock()\n\t\t\t\tresIssues = append(resIssues, issues...)\n\t\t\t\tmu.Unlock()\n\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t}).\n\t\tWithIssuesReporter(func(*linter.Context) []*goanalysis.Issue {\n\t\t\treturn resIssues\n\t\t}).\n\t\tWithLoadMode(goanalysis.LoadModeSyntax)\n}","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/nolintlint/nolintlint.go#L27-L63","documentation":"In the nolintlint analyzer wrapper, the underlying nolint linter's Run returns diagnostics plus an error; any error is wrapped as \"linter failed to run\" and propagates out of the analysis pass, aborting nolintlint for the package. This indicates nolintlint itself failed (internal issue), not that it found bad nolint directives.","triggerScenarios":"lnt.Run(pass) returns a non-nil error while the nolintlint analyzer processes a package — e.g. internal directive-parsing failures, unexpected AST/position state, or bugs in the nolint library on edge-case comments.","commonSituations":"Malformed or exotic //nolint comment combinations triggering library edge cases; running a golangci-lint version with a known nolintlint bug; packages with unusual comment positioning (cgo, generated code).","solutions":["Update golangci-lint to the latest release to pick up nolintlint fixes.","Reformat the suspicious //nolint comments (e.g. //nolint:lintname // reason form) and re-run.","Exclude the problematic files via skip-files or disable nolintlint temporarily to unblock CI.","Reproduce with the wrapped %w cause and file an issue on golangci-lint if it persists."],"exampleFix":"// before\nfoo() //nolint\n// after\nfoo() //nolint:errcheck // intentional ignore","handlingStrategy":"try-catch","validationCode":"// pre-lint: run with --no-config on a copy of the package to isolate whether nolintlint config/comments trigger the failure","typeGuard":null,"tryCatchPattern":"if err := nolintlintRun(pass); err != nil {\n    log.Printf(\"nolintlint failed: %v\", errors.Unwrap(err))\n    // degrade gracefully: continue lint run without nolintlint results\n}","preventionTips":["Keep golangci-lint up to date to avoid known nolintlint bugs.","Use the documented //nolint:name // reason comment format.","Avoid exotic nolint directive forms in generated code; exclude such files."],"tags":["golang","linter","nolintlint","static-analysis"],"backgroundTag":"linter-run-failed","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}