mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-08 14:04:59 +08:00
Enable more revive
linter rules (#30608)
Noteable additions: - `redefines-builtin-id` forbid variable names that shadow go builtins - `empty-lines` remove unnecessary empty lines that `gofumpt` does not remove for some reason - `superfluous-else` eliminate more superfluous `else` branches Rules are also sorted alphabetically and I cleaned up various parts of `.golangci.yml`.
This commit is contained in:
.golangci.yml
cmd
models
asymkey
db
issues
migrations
organization
project
repo
user
modules
auth/password
git
indexer
log
markup/markdown
packages/rubygems
process
repository
setting
templates
util
routers
api
actions
packages
alpine
conan
conda
container
cran
debian
generic
goproxy
nuget
rpm
rubygems
v1/repo
private
web/repo
services
actions
auth/source/ldap
context
gitdiff
issue
markup
migrations
mirror
pull
repository
user
webhook
tests
@ -251,18 +251,18 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
len := objectFormat.FullLength()
|
||||
length := objectFormat.FullLength()
|
||||
commits := []*Commit{}
|
||||
shaline := make([]byte, len+1)
|
||||
shaline := make([]byte, length+1)
|
||||
for {
|
||||
n, err := io.ReadFull(stdoutReader, shaline)
|
||||
if err != nil || n < len {
|
||||
if err != nil || n < length {
|
||||
if err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
return commits, err
|
||||
}
|
||||
objectID, err := NewIDFromString(string(shaline[0:len]))
|
||||
objectID, err := NewIDFromString(string(shaline[0:length]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user