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

cover: use CamelCase for coverage variable #2984

Closed

Commits on Oct 13, 2021

  1. cover: use CamelCase for coverage variable

    During the invocation of 'bazel coverage', rules_go will rewrite the
    source files using 'go tool cover -var <cover var name> ...' so that the
    variable can be extracted for coverage statistic later. For more
    information on this, review the relevant Official Go Team's blog post (1).
    
    rules_go currently injecting a variable using `Cover_snake_case` which
    is natural to starlark and python, however this will strip up some
    golang static analyzer for not following the `CamelCase` variable naming
    convention. In particular, if the generated source for coverage is run
    against `staticcheck`'s ST1003 installed as part of `nogo`, it will
    fail.
    
    Apply snake_case to CamelCase conversion on all coverage variables.
    
    (1): https://go.dev/blog/cover
    Son Luong Ngoc committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    8fd37e3 View commit details
    Browse the repository at this point in the history