{"record":{"id":"15fff92c757dab92","repo":"go-task/task","slug":"task-w-s","errorCode":null,"errorMessage":"task: %w \"%s\"","messagePattern":"task: %w \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/fingerprint/sources.go","lineNumber":22,"sourceCode":"\t\"fmt\"\n\n\t\"github.com/go-task/task/v3/errors\"\n)\n\n// ErrInvalidMethod lets callers that only need a fingerprint value tell a bad\n// method name apart from a checker failing on the sources themselves.\nvar ErrInvalidMethod = errors.New(\"invalid method\")\n\nfunc NewSourcesChecker(method, tempDir string, dry bool) (SourcesCheckable, error) {\n\tswitch method {\n\tcase \"timestamp\":\n\t\treturn NewTimestampChecker(tempDir, dry), nil\n\tcase \"checksum\":\n\t\treturn NewChecksumChecker(tempDir, dry), nil\n\tcase \"none\":\n\t\treturn NoneChecker{}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(`task: %w \"%s\"`, ErrInvalidMethod, method)\n\t}\n}\n","sourceCodeStart":4,"sourceCodeEnd":25,"githubUrl":"https://github.com/go-task/task/blob/385e5ad92af02877b6d7cf9dcc963b5ed916e70a/internal/fingerprint/sources.go#L4-L25","documentation":"The `sources:` fingerprint mechanism validates its `method:` attribute against known checkers (timestamp, checksum, none). An unknown method returns this error, wrapped with ErrInvalidMethod (so errors.Is(err, task.ErrInvalidMethod) works). It comes from NewSourcesChecker via resolveSourcesChecker when setting up a task's up-to-date checking.","triggerScenarios":"A task defines `sources:` with `method: <value>` where <value> is not timestamp, checksum, or none; resolveSourcesChecker then fails while building the task execution plan.","commonSituations":"Typos like `method: hash` or `method: mtime`, copying config from other build tools (make, bazel) with different option names, or uppercase values (`method: Checksum`).","solutions":["Use one of the supported methods: timestamp, checksum, or none","Omit `method:` entirely to use the default instead of guessing a value","Check Task's documentation/version — supported methods are limited to these three"],"exampleFix":"# before\nsources:\n  - src/**/*\n  method: hash\n# after\nsources:\n  - src/**/*\n  method: checksum","handlingStrategy":"validation","validationCode":"var validMethods = map[string]bool{\"timestamp\":true,\"checksum\":true,\"none\":true}\nif m := taskDef.Method; m != \"\" && !validMethods[m] {\n  return fmt.Errorf(\"invalid sources method %q\", m)\n}","typeGuard":null,"tryCatchPattern":"err := t.Run(ctx)\nif err != nil && errors.Is(err, task.ErrInvalidMethod) {\n  // rewrite method to \"checksum\" (default) and retry\n}","preventionTips":["Only set method: to timestamp, checksum, or none","Omit method: to accept the default instead of guessing","Run schema validation/linting on Taskfiles in CI"],"tags":["taskfile","fingerprint","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"385e5ad92af02877b6d7cf9dcc963b5ed916e70a","analyzedAt":"2026-09-05T09:01:05.226Z","contentChangedAt":"2026-09-05T09:01:05.226Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}