-
Notifications
You must be signed in to change notification settings - Fork 78
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
Update license headers / Format codes #2324
Update license headers / Format codes #2324
Conversation
Signed-off-by: kpango <kpango@vdaas.org>
Signed-off-by: Vdaas CI <vald@vdaas.org>
Deploying with Cloudflare Pages
|
[WARNING:INTCFG] Changes in |
[CHATOPS:HELP] ChatOps commands.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
golangci
pkg/agent/core/faiss/service/faiss.go|1301 col 4| return both the nil
error and invalid value: use a sentinel error instead (nilnil)
pkg/agent/core/faiss/service/faiss.go|1261 col 5| SA4006: this value of err
is never used (staticcheck)
pkg/agent/core/faiss/service/faiss.go|1263 col 5| SA4006: this value of err
is never used (staticcheck)
pkg/agent/core/faiss/service/option.go|193 col 20| SA4003: no value of type int64 is greater than math.MaxInt64 (staticcheck)
pkg/agent/core/faiss/config/config.go|17 col 1| ST1000: package comment should be of the form "Package config ..." (stylecheck)
internal/observability/metrics/agent/core/faiss/faiss.go|1 col 1| ST1000: package comment should be of the form "Package faiss ..." (stylecheck)
pkg/agent/core/faiss/usecase/agentd.go|17 col 1| ST1000: at least one file in a package should have a package comment (stylecheck)
isIndexing.Observe(ctx, int64(indexing)) | ||
o.ObserveInt64(uuidCount, int64(im.indexer.NumberOfUUIDs())) | ||
o.ObserveInt64(uncommittedUUIDCount, int64(im.indexer.NumberOfUncommittedUUIDs())) | ||
o.ObserveInt64(isIndexing, int64(indexing)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
unnecessary conversion (unconvert)
import "C" | ||
|
||
import ( | ||
"sync" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
import 'sync' is not allowed from list 'main': sync is allowed only by internal/sync (depguard)
"path/filepath" | ||
"reflect" | ||
"runtime" | ||
"sync/atomic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
import 'sync/atomic' is not allowed from list 'main': sync is allowed only by internal/sync (depguard)
|
||
err = file.MoveDir(ctx, f.path, f.oldPath) | ||
if err != nil { | ||
log.Warnf("failed to backup backup data from %s to %s error: %v", f.path, f.oldPath, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Duplicate words (backup) found (dupword)
case <-sTick.C: | ||
err = f.SaveIndex(ctx) | ||
} | ||
if err != nil && err != errors.ErrUncommittedIndexNotFound { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
) | ||
|
||
type ( | ||
Faiss interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
the interface has more than 10 methods: 23 (interfacebloat)
"github.com/vdaas/vald/pkg/agent/core/faiss/handler/grpc" | ||
) | ||
|
||
type Handler interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
the interface has more than 10 methods: 16 (interfacebloat)
return nil | ||
} | ||
|
||
func (f *faiss) load(ctx context.Context, path string, opts ...core.Option) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Function name: load, Cyclomatic Complexity: 50, Halstead Volume: 6119.72, Maintainability Index: 18 (maintidx)
return nil, errors.ErrCreateIndexingIsInProgress | ||
} | ||
if errors.Is(err, errors.ErrSearchResultEmptyButNoDataStored) && f.Len() == 0 { | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
return both the nil
error and invalid value: use a sentinel error instead (nilnil)
func (f *faiss) toSearchResponse(sr []algorithm.SearchResult) (res *payload.Search_Response, err error) { | ||
if len(sr) == 0 { | ||
if f.Len() == 0 { | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
return both the nil
error and invalid value: use a sentinel error instead (nilnil)
Update license headers / Format Go codes and YAML files.