Linter issues with depguard while working on CloudQuery PR

Hi! I’m working on a PR for addressing issue #13555 but I’m running into linter problems - depguard is running amok. Could someone give me pointers on how to resolve?

▶ make lint
golangci-lint run --config ../../.golangci.yml 
resources/services/actions/workflows.go:8:2: import 'github.com/cloudquery/cloudquery/plugins/source/github/client' is not allowed from list 'Main' (depguard)
    "github.com/cloudquery/cloudquery/plugins/source/github/client"
    ^
resources/services/actions/workflows.go:9:2: import 'github.com/cloudquery/plugin-sdk/schema' is not allowed from list 'Main' (depguard)
    "github.com/cloudquery/plugin-sdk/schema"
    ^
resources/services/actions/workflows.go:10:2: import 'github.com/cloudquery/plugin-sdk/transformers' is not allowed from list 'Main' (depguard)
    "github.com/cloudquery/plugin-sdk/transformers"
    ^
resources/services/actions/workflows.go:11:2: import 'github.com/google/go-github/v48/github' is not allowed from list 'Main' (depguard)
    "github.com/google/go-github/v48/github"

(etc)

Hi @bouncy-pepper, happy to help, but I’m not sure what this error is saying. Do you have a branch or some code you can link to?

A handy tip is also to run

go mod tidy

before the lint step; sometimes not doing so can cause confusing errors.

Might be something in my local environment. I’ll issue a PR to see what the CI checks say. It’s in this pull request and you can see the CI checks here.

Ok, that’s another error message :smile:.

Ah okay, that might be the real error :slightly_smiling_face:

FWIW, I get the same error when I run your branch locally. My best guess is that it’s depguard complaining about the crypto/rsa import?

Hm yeah, that’s the one difference in imports :man_shrugging: just weird that it’s complaining about the other ones, too.

Running it on the main branch, I get the same errors.

Could it be similar to what is described here? GitHub Issue #49

The CI check runs golangci-lint 1.52.2, and that works locally for me as well. It doesn’t yield the errors I see in the CI check step though. :thinking:

I checked it out now, and it seems like when you add the err declaration, it fixes the issue. I pushed a commit to your branch to confirm that it’s also fixed in CI.