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

bazel: set correct flags for printf analyzer #90812

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

rickystewart
Copy link
Collaborator

Closes #80006.

Release note: None
Epic: CRDB-8349

@rickystewart rickystewart requested a review from a team as a code owner October 27, 2022 22:22
@rickystewart rickystewart changed the title bazel: set correct flags for printf` analyzer bazel: set correct flags for printf analyzer Oct 27, 2022
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@healthy-pod healthy-pod left a comment

Choose a reason for hiding this comment

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

Since lint_test.go is a go file we can keep them synced by reading nogo_config.json. Drawback is if schema changes this breaks (but at least it breaks and we know and fix it compared to drifting silently otherwise). Not sure which is better, up to you.

@healthy-pod
Copy link
Contributor

jsonFile, err := os.ReadFile(nogo_config_file)
if err != nil {
// deal with err
}
var printSchema map[string]map[string]map[string]string
if err := json.Unmarshal(jsonFile, &printSchema); err != nil {
// deal with err
}
printfuncs := printSchema["printf"]["analyzer_flags"]["funcs"]

@jlinder
Copy link
Collaborator

jlinder commented Oct 28, 2022

Note that since the epic is linked in the referenced issue's body, the epic ref isn't necessary.

Closes cockroachdb#80006.

Release note: None
Epic: CRDB-8349
@rickystewart
Copy link
Collaborator Author

bors r=rail,healthy-pod

@craig
Copy link
Contributor

craig bot commented Oct 28, 2022

Build succeeded:

@craig craig bot merged commit 3064717 into cockroachdb:master Oct 28, 2022
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.

bazel: make sure we're configuring the correct set of printf funcs for roachvet checks in nogo
5 participants