-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add golangci #6418
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
Merged
Merged
Add golangci #6418
Changes from 104 commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
538eded
Added golangci-lint
kolaente 86b0ce5
Autofix
kolaente a4a1fe0
Fixed a lot of lint errs
kolaente 49b7083
Fixed more errors
kolaente 5dc1bb0
Fixed err
kolaente 26accd2
Fixed some more lint errors
kolaente db707e9
Fixed most issues
kolaente c7aedad
Fixed more issues
kolaente 5a3bbe1
Merge branch 'gitea-master' into golanci
kolaente 95b89b1
Merge with gitea-master
kolaente e18f584
Fixed more issues
kolaente 4522535
Renamed lint to revive
kolaente c5b223a
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente 0dad3b6
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente 1a7609c
Merge with gitea-master
kolaente ed28312
Removed unused template file
kolaente 18bf983
Fixed lint errors
kolaente 073e9c0
Merge with gitea-master
kolaente a2a16b9
Fixed lint errors
kolaente 5523208
Merge with gitea-master
kolaente e426b40
Fix error handling
kolaente 52d07f6
Fix error handling
kolaente 00c0107
Updated version
kolaente 612e09a
fixed lint errors
kolaente bce1b4c
Merge branch 'master' into golanci
kolaente 5a498c6
fixed lint errors
kolaente ad2c642
fixed lint errors
kolaente d923a72
fixed lint errors
kolaente bf83f63
Merge branch 'master' into golanci
kolaente 7a90087
Merge branch 'master' into golanci
kolaente ba9aaef
fixed lint errors
kolaente 9f04b4e
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente f9e650f
Fixed lint errors
kolaente eaa5a15
Fixed some failing unit tests
kolaente 9c85563
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente 75b352e
merge with gitea-master
kolaente df7f0bf
Fixed some lint issues
kolaente c341b60
Fixed some lint issues
kolaente 0566bdf
Fixed lint errors
kolaente 207a9c3
Merge with gitea-master
kolaente 3240b37
Fixed lint issues
kolaente 96f2148
Use crypto/rand instead of math/rand
kolaente 3a4a369
Update modules/lfs/locks.go
zeripath e6dc55d
Update modules/lfs/locks.go
zeripath 8232200
Update modules/lfs/locks.go
zeripath 8cd3b09
rearranged imports
kolaente fed01f6
Merge branch 'master' into golanci
kolaente 1f213bd
fmt
kolaente bac180a
Merge remote-tracking branch 'origin/golanci' into golanci
kolaente 292b374
Merge branch 'master' into golanci
kolaente 676eb5f
Merge branch 'master' into golanci
kolaente 49b03ac
Merge with gitea-master
kolaente 751900c
Fixed lint errors
kolaente fe9b4b7
Merge branch 'master' into golanci
kolaente 7ddb9df
Merge branch 'master' into golanci
kolaente ca25205
Merge branch 'master' into golanci
kolaente 6db1908
Merge branch 'master' into golanci
kolaente 01c390a
Merge branch 'master' into golanci
kolaente d6a6f2d
Merge branch 'master' into golanci
kolaente 0d1488a
Fixed lint issues
kolaente 8fd5962
Removed fixme
kolaente d845651
Merge branch 'master' into golanci
kolaente cab2bda
Merge branch 'master' into golanci
kolaente 160e86f
Merge branch 'master' into golanci
kolaente 5bd754f
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente 26cf168
Fixed Wrong change
kolaente 25bf975
Sorted imports
kolaente dab7850
More error handling
kolaente a8dfe8b
Merge branch 'master' into golanci
kolaente 2a461f1
More error handling
kolaente 2143cea
Update modules/markup/html.go
ngourdon c6cf8e3
More error handling + sort order
kolaente f1b90f0
Merge remote-tracking branch 'origin/golanci' into golanci
kolaente 2a8aa70
Fixed css
kolaente 1fb8ead
Merge branch 'master' into golanci
kolaente 8a45df9
Fixed unneded raw strings
kolaente b45517a
Merge branch 'master' into golanci
kolaente 3cca1da
Merge branch 'master' into golanci
kolaente 376a9f4
Merge branch 'master' into golanci
kolaente 8671bcb
Merge branch 'master' into golanci
kolaente 7e20300
Fixed a lot of lint issues
kolaente 11b2509
css
kolaente 3feb9eb
Merge branch 'master' into golanci
kolaente b3b6042
Merge branch 'master' into golanci
kolaente 54d9a6f
Merge branch 'master' into golanci
kolaente 25b5800
Merge branch 'master' into golanci
kolaente 40be393
Fixed lint
kolaente e640971
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente 5164aa0
Fixed some lint issues
kolaente ade65b2
Update models/login_source.go
kolaente fc7d386
Merge remote-tracking branch 'origin/golanci' into golanci
kolaente 2d9eeed
Update routers/repo/http.go
kolaente 427f778
Update routers/repo/http.go
kolaente e43c3f9
Merge remote-tracking branch 'origin/golanci' into golanci
kolaente 38691f5
Log error instead of returning it when rolling a session back
kolaente e07b770
Log error instead of returning it when rolling a session back
kolaente 2c9c43f
Always return, don't ignore
kolaente 19adbe0
Log the error when deleting/restoring because of a previous error
kolaente 9da3590
Only log the error when closing an sql row set
kolaente d9c8a5f
Scoped tmp path wiki removing
kolaente 853fd7b
merge with gitea-master
kolaente 54f0f41
Fixed lint errors
kolaente 6f53a9c
Fixed wiki test
kolaente 99c9837
Always scoped errors in defer function calls
kolaente 3684708
removed unneeded named return
kolaente 34cfe33
Fixed instance of the xorm not being passed and used correctly
kolaente 7294d13
Added extra method to pass the xorm session to getReleaseAttachments
kolaente ba5d2c0
merge with gitea-master
kolaente 914e5a5
Fixed lint errors
kolaente 4dc710b
Merge branch 'master' into golanci
kolaente 86d62f4
Merge branch 'master' into golanci
kolaente 0866502
Merge branch 'master' into golanci
kolaente efb4ab7
Smaller fixes
kolaente e7ca38d
Merge branch 'master' into golanci
kolaente 097b0dd
Merge branch 'master' of github.com:go-gitea/gitea into golanci
kolaente cbf861d
Re-added validation
kolaente c760c02
Fix ShowSubcommandHelp behaviour
jonasfranz 9f5ba0d
Merge branch 'master' into golanci
kolaente 4a865f4
Merge branch 'master' into golanci
lunny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
linters: | ||
enable: | ||
- gosimple | ||
- deadcode | ||
- typecheck | ||
- govet | ||
- errcheck | ||
- staticcheck | ||
- unused | ||
- structcheck | ||
- varcheck | ||
- golint | ||
- dupl | ||
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time. | ||
- gofmt | ||
- misspell | ||
- gocritic | ||
enable-all: false | ||
disable-all: true | ||
fast: false | ||
|
||
linters-settings: | ||
gocritic: | ||
disabled-checks: | ||
- ifElseChain | ||
- singleCaseSwitch # Every time this occured in the code, there was no other way. | ||
|
||
issues: | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- gocyclo | ||
- errcheck | ||
- dupl | ||
- gosec | ||
- unparam | ||
- staticcheck | ||
- path: models/migrations/v | ||
linters: | ||
- gocyclo | ||
- errcheck | ||
- dupl | ||
- gosec | ||
- linters: | ||
- dupl | ||
text: "webhook" | ||
- linters: | ||
- gocritic | ||
text: "`ID' should not be capitalized" | ||
- path: modules/templates/helper.go | ||
linters: | ||
- gocritic | ||
- linters: | ||
- unused | ||
- deadcode | ||
text: "swagger" | ||
- path: contrib/pr/checkout.go | ||
linters: | ||
- errcheck | ||
- path: models/issue.go | ||
linters: | ||
- errcheck | ||
- path: models/migrations/ | ||
linters: | ||
- errcheck | ||
- path: modules/log/ | ||
linters: | ||
- errcheck | ||
- path: routers/routes/routes.go | ||
linters: | ||
- dupl | ||
- path: routers/repo/view.go | ||
linters: | ||
- dupl | ||
- path: models/migrations/ | ||
linters: | ||
- unused | ||
- linters: | ||
- staticcheck | ||
text: "argument x is overwritten before first use" | ||
- path: modules/httplib/httplib.go | ||
linters: | ||
- staticcheck | ||
# Enabling this would require refactoring the methods and how they are called. | ||
- path: models/issue_comment_list.go | ||
linters: | ||
- dupl | ||
# "Destroy" is misspelled in github.com/go-macaron/session/session.go:213 so it's not our responsability to fix it | ||
- path: modules/session/virtual.go | ||
linters: | ||
- misspell | ||
text: '`Destory` is a misspelling of `Destroy`' | ||
- path: modules/session/memory.go | ||
linters: | ||
- misspell | ||
text: '`Destory` is a misspelling of `Destroy`' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.