Skip to content

Add yamlfmt to task fmt#4181

Open
mmatczuk wants to merge 1 commit intomainfrom
mmt/yamlfmt
Open

Add yamlfmt to task fmt#4181
mmatczuk wants to merge 1 commit intomainfrom
mmt/yamlfmt

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

No description provided.

run: once
silent: true
cmds:
- GOBIN={{.GOBIN}} go install github.com/google/yamlfmt/cmd/yamlfmt@latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-reproducible dependency: @latest means every invocation can install a different version of yamlfmt, which can cause inconsistent formatting across developers and CI. The existing install-golangci-lint task pins to a specific version via a variable and uses sources for caching.

Pin yamlfmt to a specific version (e.g., @v0.16.0) using a variable (like GOLANGCI_LINT_VERSION), and add a sources block so the task is cached and only re-runs when the version changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Claude suggests, would it be better to pin it to a specific version for consistency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My take is that it's the legacy of the future, who would bump it and why?

@claude
Copy link
Copy Markdown

claude bot commented Mar 27, 2026

Commits
LGTM

Review
The PR adds yamlfmt as a YAML formatting tool to the task fmt pipeline. One issue found with dependency management.

  1. Non-reproducible dependency (taskfiles/tools.yml#L31): install-yamlfmt uses @latest instead of a pinned version, unlike the existing install-golangci-lint pattern which pins via a version variable and uses sources for caching. This can cause inconsistent formatting across environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants