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

Allow nogo to run against all dependencies #4241

Open
fionera opened this issue Jan 24, 2025 · 3 comments
Open

Allow nogo to run against all dependencies #4241

fionera opened this issue Jan 24, 2025 · 3 comments

Comments

@fionera
Copy link

fionera commented Jan 24, 2025

As discussed via Slack, I would like to have a way to get the old behavior back. I am using bzlmod and would like to tell nogo to run against all third_party code

@fionera
Copy link
Author

fionera commented Jan 24, 2025

Woopsydaisy I just noticed this is actually a Bug :D

When I run nogo with the default setting, nothing will be reported.

go_sdk.nogo(
    excludes = [],
    includes = [
        "@@//:__subpackages__",
    ],
    nogo = "//build/analysis:nogo",
)

As soon as I change it to a config that includes third_party dependencies, it shows me the deprecation notices that the analyzers should have caught.

go_sdk.nogo(
    excludes = [],
    includes = [
        "@@//:__subpackages__",
        "@org_golang_google_grpc//:__subpackages__",
    ],
    nogo = "//build/analysis:nogo",
)

Turns out, nogo currently ignores all calls to third party code?

@bazel-contrib bazel-contrib deleted a comment Jan 24, 2025
@fmeum
Copy link
Member

fmeum commented Jan 24, 2025

Some nogo analyzers may require data collected from third-party packages to be effective. We could make it so that they still run, just don't warn or fail, but that would need knowing which ones these are. I'm not familiar enough with nogo to suggest something.

@fionera
Copy link
Author

fionera commented Jan 24, 2025

I would suggest to use the deps attribute to determine which additional targets to include

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

No branches or pull requests

2 participants