-
Notifications
You must be signed in to change notification settings - Fork 204
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
Conversation
@@ -103,6 +103,7 @@ tasks: | |||
desc: Ensure all code is formatted | |||
dir: v2 | |||
cmds: | |||
- golangci-lint run --fix ./... |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ./... |
There was a problem hiding this comment.
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?
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 theformat-code
task in theTaskfile.yml
makes this easy to access.How does this PR make you feel?