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

Tracking issue: Updating golangci-lint #17596

Closed
8 tasks done
Gusted opened this issue Nov 9, 2021 · 3 comments
Closed
8 tasks done

Tracking issue: Updating golangci-lint #17596

Gusted opened this issue Nov 9, 2021 · 3 comments

Comments

@Gusted
Copy link
Contributor

Gusted commented Nov 9, 2021

This is a tracking-issue to update golangci-lint to a newer version - this is just to track which errors has to be fixed that comes up with the newer version of golangci-lint, v1.43.0.
The new update seems to catch more errors, which is always nice to have.

Gusted pushed a commit to Gusted/gitea that referenced this issue Nov 9, 2021
- Partially resoles go-gitea#17596
- Resolves SA4023 errors.
- Ensure correctly that typed interface are nil.
Gusted pushed a commit to Gusted/gitea that referenced this issue Nov 10, 2021
- Partially resolves go-gitea#17596
- Resolve errors from go-critic `offBy1: Index() can return -1; maybe
you wanted to do Index()+1`.
Gusted pushed a commit to Gusted/gitea that referenced this issue Nov 10, 2021
- Partialy resolvess go-gitea#17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.
Gusted pushed a commit to Gusted/gitea that referenced this issue Nov 10, 2021
- Partialy resolvess go-gitea#17596
- In the newer versions of `golangci-lint`, golint is  deprecated and
replaced by the `revive` linter. Thus removing the `golint` linter is a
good idea, as we're already using the `revive` linter which covers all
the current `golint` cases.
Gusted pushed a commit to Gusted/gitea that referenced this issue Nov 10, 2021
- Partially resolvess go-gitea#17596
- Download specific version(v1.43.0) by default.
- If current installed version is older than the minium version, it will
download the mininium required version.
- Update the install script to avoid deprecated error
`golangci/golangci-lint err this script is deprecated, please do not use
it anymore. check https://github.com/goreleaser/godownloader/issues/207`
lunny added a commit that referenced this issue Nov 11, 2021
- Partialy resolvess #17596
- In the newer versions of `golangci-lint`, golint is  deprecated and
replaced by the `revive` linter. Thus removing the `golint` linter is a
good idea, as we're already using the `revive` linter which covers all
the current `golint` cases.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 14, 2021

(The issue was closed by PR merging automatically, reopen it. How to prevent the issue from being closed automatically?)

@wxiaoguang wxiaoguang reopened this Nov 14, 2021
@Gusted
Copy link
Contributor Author

Gusted commented Nov 14, 2021

(The issue was closed by PR merging automatically, reopen it. How to prevent the issue from being closed automatically?)

Not really, when using closing keywords on github, they will just happen. On the PRs I've on purpose add a little spelling mistake so it wont be recognized as closing keyword, this one got slipped trough.

lunny added a commit that referenced this issue Nov 15, 2021
- Partialy resolvess #17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
lunny added a commit that referenced this issue Nov 15, 2021
* Fix nil checking on typed interface

- Partially resoles #17596
- Resolves SA4023 errors.
- Ensure correctly that typed interface are nil.

* Remove unnecessary code

`NewBleveIndexer` will never return nil, even on errors.

* Patch `NewBleveIndexer`

* Fix low-level functions

* Remove deadcode

* Fix GetSession

* Close Elastic search when err isn't nil

* Update elastic_search.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
lunny added a commit that referenced this issue Nov 17, 2021
* Update golangci-lint in Makefile

- Partially resolvess #17596
- Download specific version(v1.43.0) by default.
- If current installed version is older than the minium version, it will
download the mininium required version.
- Update the install script to avoid deprecated error
`golangci/golangci-lint err this script is deprecated, please do not use
it anymore. check https://github.com/goreleaser/godownloader/issues/207`

* Simplify golangci-lint version check

* Fix version conversion

* Add version that's downloading

Co-authored-by: zeripath <art27@cantab.net>

* Consistency

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@Gusted
Copy link
Contributor Author

Gusted commented Nov 19, 2021

Closing

@Gusted Gusted closed this as completed Nov 19, 2021
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
- Partialy resolvess go-gitea#17596
- In the newer versions of `golangci-lint`, golint is  deprecated and
replaced by the `revive` linter. Thus removing the `golint` linter is a
good idea, as we're already using the `revive` linter which covers all
the current `golint` cases.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Fix offBy1 errors

- Partially resolves go-gitea#17596
- Resolve errors from go-critic `offBy1: Index() can return -1; maybe
you wanted to do Index()+1`.

* Match golang spec

* Remove comments

* Update migrations.go

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
- Partialy resolvess go-gitea#17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Fix nil checking on typed interface

- Partially resoles go-gitea#17596
- Resolves SA4023 errors.
- Ensure correctly that typed interface are nil.

* Remove unnecessary code

`NewBleveIndexer` will never return nil, even on errors.

* Patch `NewBleveIndexer`

* Fix low-level functions

* Remove deadcode

* Fix GetSession

* Close Elastic search when err isn't nil

* Update elastic_search.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Update golangci-lint in Makefile

- Partially resolvess go-gitea#17596
- Download specific version(v1.43.0) by default.
- If current installed version is older than the minium version, it will
download the mininium required version.
- Update the install script to avoid deprecated error
`golangci/golangci-lint err this script is deprecated, please do not use
it anymore. check https://github.com/goreleaser/godownloader/issues/207`

* Simplify golangci-lint version check

* Fix version conversion

* Add version that's downloading

Co-authored-by: zeripath <art27@cantab.net>

* Consistency

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants