Skip to content

Support running all tasks even on errors #1853

@xremming

Description

@xremming

So in my use case I'm consolidating all different linters (among other things) to be ran with the Taskfile. See the snippet below for the general structure.

When running linters it would be nice to run all of them always (the same is especially true with the for loop) and once they're all ran to return an error if any of them errored. I could work around this by using longer shell scripts but I would prefer not to.

I'm thinking something like a run_all: always parameter. The default for which could be the current behaviour of stop-on-first-error.

The ignore_error works otherwise but it also ignores the error code, meaning that when the linters are ran in CI it will not cause the run to fail.

tasks:
  lint:
    deps: [lint:terraform:fmt, lint:terraform:tflint]

  lint:terraform:fmt:
    dir: infra
    cmd: "terraform fmt -check -recursive"

  lint:terraform:tflint:
    deps: [install:tflint]
    dir: infra
    vars:
      STACKS:
        sh: "echo stacks/*"
    cmd:
      for:
        var: STACKS
      cmd: "tflint --config=../../.tflint.hcl --chdir={{ .ITEM }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions