Skip to content

Incorrect godoc comments on WithVersionCheck and WithFailfast in executor.go #2962

Description

@Nithwin

Bug Report: Incorrect Godoc Comments on WithVersionCheck and WithFailfast

Description

Two With* option constructor functions in executor.go have copy-pasted, incorrect doc comments that describe the wrong behaviour. This is a documentation bug that will mislead anyone reading the API via go doc or pkg.go.dev.

Location

File: executor.go

WithVersionCheck (line 612):

// WithVersionCheck tells the [Executor] whether or not to check the version of
func WithVersionCheck(enableVersionCheck bool) ExecutorOption {

The comment is incomplete/truncated — it doesn't say what it checks the version of, and it never finishes the sentence.

WithFailfast (line 625):

// WithFailfast tells the [Executor] whether or not to check the version of
func WithFailfast(failfast bool) ExecutorOption {

The comment for WithFailfast is wrong — it's a direct copy of the incomplete WithVersionCheck comment. WithFailfast has nothing to do with version checking; it configures whether the executor stops immediately when any task fails.

Expected Behaviour

  • WithVersionCheck should have a comment that accurately describes enabling/disabling the Taskfile schema version check.
  • WithFailfast should have a comment describing that it configures the executor to stop executing further tasks after the first failure.

Suggested Fix

// WithVersionCheck tells the [Executor] whether or not to check the schema
// version of the Taskfile before running.
func WithVersionCheck(enableVersionCheck bool) ExecutorOption {

// WithFailfast tells the [Executor] to stop running tasks as soon as any task
// returns an error.
func WithFailfast(failfast bool) ExecutorOption {

Steps to Reproduce

  1. Open executor.go
  2. Navigate to line 612 (WithVersionCheck) and line 625 (WithFailfast)
  3. Observe that both comments say "tells the [Executor] whether or not to check the version of" — WithFailfast's comment is clearly copy-pasted from WithVersionCheck and is wrong.

Impact

  • Misleads library consumers reading Go docs
  • WithFailfast is particularly confusing since its comment describes an unrelated feature

Contribution

I'd like to submit a fix for this. This is a simple documentation-only change with no behaviour impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions