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

Update license headers / Format codes #2324

Closed

Conversation

vdaas-ci
Copy link
Collaborator

@vdaas-ci vdaas-ci commented Feb 7, 2024

Update license headers / Format Go codes and YAML files.

Copy link

cloudflare-pages bot commented Feb 7, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c9ce523
Status: ✅  Deploy successful!
Preview URL: https://f58ff893.vald.pages.dev
Branch Preview URL: https://formatter-go-and-yaml-format-jbtw.vald.pages.dev

View logs

@vdaas-ci
Copy link
Collaborator Author

vdaas-ci commented Feb 7, 2024

[WARNING:INTCFG] Changes in interal/config may require you to change Helm charts. Please check.

@vdaas-ci
Copy link
Collaborator Author

vdaas-ci commented Feb 7, 2024

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Copy link
Contributor

@github-actions github-actions bot left a 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))
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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)
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants