-
Notifications
You must be signed in to change notification settings - Fork 152
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
Configuration File .golangci.yml
for golangci-lint
Runs
#1921
Conversation
cf90a39
to
6f1fa2b
Compare
6f1fa2b
to
e6e5ce9
Compare
- text: "`ctx` is unused" # Context might not be in use in places, but for consistency, we pass it. | ||
linters: | ||
- unparam |
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.
We might want to address this. Can be addressed separately
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.
LGTM
@Bhargav-InfraCloud |
Makes sense. Thanks for letting me know and the approval. |
@Bhargav-InfraCloud could you please add attach the output of |
Move the default linter's config to .golangci.yaml file. The 7 default linters: errcheck, gosimple, govet, ineffassign, staticcheck, typecheck & unused. Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
Move gofmt linter run to .golangci.yaml file. Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
Move custom linters to .golangci.yaml file. 4 custom linters: maligned, whitespace, gocognit & unparam Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
Reasons: - Linter maligned is archived by owner and deprecated from golangci-lint. - maligned (or it's replacement: govet's fieldalignment) recommends >50 struct's field alignment. Too many changes for much less value. - Struct fields might be ordered per their similarities. Rearranging for saving few bytes is not reasonable. Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
e6e5ce9
to
f363a28
Compare
@PrasadG193 My bad I missed it. I've updated the desc now and rebased the code with the latest on master. Please check. |
Thanks @PrasadG193 😊 |
Change Overview
Configuration file
.golangci.yml
forgolangci-lint
runs as explained in #1761.Changes
errcheck
,gosimple
,govet
,ineffassign
,staticcheck
,typecheck
&unused
) from.golangci.yaml
.gofmt
from.golangci.yaml
.maligned
,whitespace
,gocognit
&unparam
) from.golangci.yaml
.maligned
due to following reasons:maligned
is archived by owner and deprecated fromgolangci-lint
.maligned
(or it's replacement: govet's fieldalignment) recommends >50 struct's field alignment. Too many changes for much less value.Pull request type
Please check the type of change your PR introduces:
Issues
.golangci.yml
in place of golint.sh and add additional linters #1761Test Plan
Run the command:
It should pass as it was before. Output similar to:
To Maintainers
Thegofmt
andgovet
are ran inmake golint
as well as the following scripts:1. build/test.sh2. examples/aws-rds/postgresql/pgtest/build/test.shIs there any particular reason for this or can these be eliminated from (or) replaced in scripts?This is discussed in the comments.