kevincobain2000 / gobrew

Go version manager, written in Go. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.
https://medium.com/web-developer/go-version-manager-gobrew-c8750157dfe6
MIT License
358 stars 24 forks source link

Add golangci-lint #181

Closed juev closed 5 months ago

juev commented 5 months ago

Using golangci-link makes it easier to check the code and avoid a lot of problems.

This is only a draft of changes so far.

First, after changing the golang version to 1.22 in the go.mod file, many utilities stopped working. According to issue, we corrected the version, specifying it more precisely. After that, everything worked as it should.

Performed adding a new pipe and configuration for golangci-lint to standardize checks.

At the current moment, we have a number of problems that I plan to fix in the current PR.

Please do not merge this changes until they are ready to go.

juev commented 5 months ago

First run new pipe: https://github.com/kevincobain2000/gobrew/actions/runs/7853832380

github-actions[bot] commented 5 months ago

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
coverage 60.5% 59.2%-
build-time 3sec 3sec
go-binary-size 6.1kKB 6.1kKB
go-mod-dependencies 29 28-
go-sec-issues 6 6
unit-test-run-time 18sec 18sec

chartchartchartchartchartchart

Add Badges and Charts to Readme

kevincobain2000 commented 5 months ago

Before you and/or I start fixing - please look at this too https://github.com/kevincobain2000/gobrew/pull/182

juev commented 5 months ago

Now I have registered a list of linters that I use in regular projects. Just because they often help me find certain errors.

We can remove the bodyclose linter, as it is currently not working correctly. And we can remove predeclared, since it is not quite relevant.

We can either correct other errors or ignore them.

github-actions[bot] commented 5 months ago

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
go-sec-issues 6 5-
go-lint-errors 0 0

chartchart

Add Badges and Charts to Readme

juev commented 5 months ago

@kevincobain2000 I think that it is possible to check.

If you have any ideas about what other linters to enable or disable, you can discuss it here and now. :)

If you have any comments about the selected constant names, I am ready to listen and discuss suggestions.

github-actions[bot] commented 5 months ago

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
go-lint-errors 0 0

chart

Add Badges and Charts to Readme

kevincobain2000 commented 5 months ago

Thanks I ll push the new tag once you are ready. Please merge when you are cool with it.

juev commented 5 months ago

@kevincobain2000 Hi, I'm sorry, I was out of the access zone, I couldn't get in touch. Thank you for your prompt response!

kevincobain2000 commented 5 months ago

No worries. Thanks. I haven’t pushed the new tag after the changes. Only merged changes to master. Will do that tomorrow.