Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include golangci-lint fixes when formatting code #4461

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

theunrepentantgeek
Copy link
Member

What this PR does

Now that we're enforcing import order using gci, the exacting rule means getting a pull request across the line might be challenging.

Fortunately, there's an automated fix that we can apply by running golangci-lint with the --fix parameter. Adding this to the format-code task in the Taskfile.yml makes this easy to access.

How does this PR make you feel?

gif

@matthchr matthchr added this pull request to the merge queue Nov 22, 2024
@@ -103,6 +103,7 @@ tasks:
desc: Ensure all code is formatted
dir: v2
cmds:
- golangci-lint run --fix ./...
Copy link
Member

Choose a reason for hiding this comment

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

This is called both in the ci task and the local task default. Do we want it executed in both - is the experience w/ this changing code in CI good?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should change the verify-no-changes task to have an error that gives the cmd to run to fix things up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. Done.

@@ -103,6 +103,7 @@ tasks:
desc: Ensure all code is formatted
dir: v2
cmds:
- golangci-lint run --fix ./...
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should change the verify-no-changes task to have an error that gives the cmd to run to fix things up?

@matthchr matthchr removed this pull request from the merge queue due to a manual request Nov 22, 2024
@theunrepentantgeek theunrepentantgeek added this pull request to the merge queue Nov 25, 2024
Merged via the queue into main with commit d0dcc8c Nov 25, 2024
8 checks passed
@theunrepentantgeek theunrepentantgeek deleted the feature/format-code branch November 25, 2024 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Release
Development

Successfully merging this pull request may close these issues.

2 participants