Skip to content

Add yamlfmt to task fmt#4181

Merged
mmatczuk merged 1 commit into
mainfrom
mmt/yamlfmt
Mar 30, 2026
Merged

Add yamlfmt to task fmt#4181
mmatczuk merged 1 commit into
mainfrom
mmt/yamlfmt

Conversation

@mmatczuk

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread taskfiles/tools.yml Outdated
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

claude Bot commented Mar 27, 2026

Copy link
Copy Markdown

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.

@mmatczuk

Copy link
Copy Markdown
Contributor Author

Added version in versions file

@mmatczuk mmatczuk merged commit 53a8c23 into main Mar 30, 2026
1 check passed
@mmatczuk mmatczuk deleted the mmt/yamlfmt branch March 30, 2026 12:43
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