[MAINT] fixing linter errors (#19)

* fix linter errors

* fix exhaust linter error

* fix exhaust linter error

* fix linter errors

* golangci-lint timeout increased

* golangci-lint verbose flag
This commit is contained in:
Enver Bisevac 2022-09-22 16:08:41 +02:00 committed by GitHub
parent 560c08dcca
commit 66f2dadb7a
4 changed files with 6 additions and 4 deletions

View File

@ -106,7 +106,7 @@ sec:
lint: tools generate # lint the golang code
@echo "Linting $(1)"
@golangci-lint run
@golangci-lint run --timeout=3m --verbose
###########################################
# Code Generation

View File

@ -68,7 +68,7 @@ func HandleMove(guard *guard.Guard, repos store.RepoStore, spaces store.SpaceSto
return
}
// Ensure we have access to the target space (if its a space move)
// Ensure we have access to the target space (if it's a space move)
if *in.SpaceID != repo.SpaceID {
var newSpace *types.Space
newSpace, err = spaces.Find(ctx, *in.SpaceID)

View File

@ -59,7 +59,9 @@ func HandleMove(guard *guard.Guard, spaces store.SpaceStore) http.HandlerFunc {
if err = check.Name(*in.Name); err != nil {
render.UserfiedErrorOrInternal(w, err)
return
} else if *in.ParentID == space.ParentID && *in.Name == space.Name {
}
if *in.ParentID == space.ParentID && *in.Name == space.Name {
render.BadRequestError(w, render.ErrNoChange)
return
}

View File

@ -276,7 +276,7 @@ func (s *SpaceStore) List(ctx context.Context, id int64, opts *types.SpaceFilter
switch opts.Sort {
case enum.SpaceAttrCreated:
// NOTE: string concatination is safe because the
// NOTE: string concatenation is safe because the
// order attribute is an enum and is not user-defined,
// and is therefore not subject to injection attacks.
stmt = stmt.OrderBy("space_created " + opts.Order.String())