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

Resolves #3081: add analyzer_flags to nogo config #3082

Merged
merged 6 commits into from
Mar 26, 2022

Conversation

navijation
Copy link
Contributor

@navijation navijation commented Mar 8, 2022

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Allow nogo config to specify flags to be passed to each analyzer via analyzer_flags. The ability to provide flags to each
analyzer is something not currently supported by the driver, which makes it more troublesome to use configurable
analyzers in a Bazel Go project.

Which issues(s) does this PR fix?

#3081

Other notes for review

Being able to pass in a list of CLI arguments might add greater flexibility, but given the restrictive nature of Go's FlagSet
API, it is unlikely that any analyzers in the wild will support positional arguments and the like.

Copy link
Contributor

@sluongng sluongng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the direction looks good to me but there are some nits and copy pasting errors here and there that need to be fixed.

You would also want to add some documentation in places that mention nogo config json schema such as https://github.com/bazelbuild/rules_go/blob/master/go%2Fnogo.rst

go/tools/builders/nogo_main.go Outdated Show resolved Hide resolved
tests/core/nogo/custom/custom_test.go Outdated Show resolved Hide resolved
tests/core/nogo/custom/custom_test.go Outdated Show resolved Hide resolved
@navijation navijation changed the title Resolves #3801: add analyzer_flags to nogo config Resolves #3081: add analyzer_flags to nogo config Mar 8, 2022
Copy link
Contributor

@sluongng sluongng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few nits, but this overall looking really good.

Very nice that CI is also passing 🎉

Pinging @linzhp @robfig for further reviews

go/tools/builders/nogo_main.go Outdated Show resolved Hide resolved
go/tools/builders/nogo_main.go Show resolved Hide resolved
go/nogo.rst Show resolved Hide resolved
@linzhp
Copy link
Contributor

linzhp commented Mar 23, 2022

I can take a look later this week or weekend.

@linzhp linzhp merged commit 1691291 into bazelbuild:master Mar 26, 2022
@linzhp
Copy link
Contributor

linzhp commented Mar 26, 2022

Thanks for working on this. It's a pretty solid implementation. Thanks for reviewing too @sluongng

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

Successfully merging this pull request may close these issues.

4 participants