-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
chore(linters): Enforce import hrouping with gci linter #16526
base: master
Are you sure you want to change the base?
chore(linters): Enforce import hrouping with gci linter #16526
Conversation
Signed-off-by: Paulo Dias <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
Usually the PR to enable a linter also includes fixes to all the files not compliant, so the CI succeeds. If there are too many changes to be done, they are put in different preceding PRs, but I don't this is needed in this case as it should normally only be a small change in the top section of the file. |
@paulojmdias |
Signed-off-by: Paulo Dias <[email protected]>
@zak-pawel @Hipska I pushed the changes needed either way. Please review and let me know if it is really needed to split it into multiple PRs. |
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.
Looks good! Thanks!
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.
Great addition which will keep all the code consistent!
plugins/outputs/application_insights/mocks/diagnostics_message_subscriber.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Thomas Casteleyn <[email protected]>
…_subscriber.go Co-authored-by: Thomas Casteleyn <[email protected]>
Co-authored-by: Thomas Casteleyn <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Thanks for the epic work @paulojmdias!
You're welcome 💪 |
Summary
This PR updates golangci-lint to enforce proper import grouping using the gci linter. The import sections are now structured as follows:
The following command to fix all the modules with this linter can be executed like below. I will wait for the repo maintainers feedback to run this linter command to fix all the code needed in the repo.
gci write -s standard -s default -s localmodule .
Checklist
Related issues
The discussion comes from the following PR comment: #16509 (comment)