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

Add goreportcard.com badge #240

Closed
wants to merge 1 commit into from
Closed

Add goreportcard.com badge #240

wants to merge 1 commit into from

Conversation

dsxack
Copy link

@dsxack dsxack commented Feb 18, 2020

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no Cannot accept contribution until Google CLA is signed. label Feb 18, 2020
@dsxack
Copy link
Author

dsxack commented Feb 18, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Google CLA has been signed! and removed cla: no Cannot accept contribution until Google CLA is signed. labels Feb 18, 2020
@dsxack
Copy link
Author

dsxack commented Feb 20, 2020

I close PR because PR to awesome-go is closed.

avelino/awesome-go#2965

@dsxack dsxack closed this Feb 20, 2020
@zombiezen
Copy link
Collaborator

Hey @dsxack, thank you so much for trying to get Wire included on awesome-go. Really sorry to hear it didn't work out. I believe our test practices to be quite good for this project, but I'm not sure if there's anything we can do to demonstrate that in a way that awesome-go will accept. If you come up with something, I'd be happy to work with you on that.

@zombiezen
Copy link
Collaborator

Something worth pointing out: the files that contain the core Wire logic hover around 85%-94% coverage: https://codecov.io/gh/google/wire/tree/master/internal/wire

I think the average isn't weighted well: the main.go we intentionally don't test much because it's a thin wrapper around the well-tested library.

@dsxack
Copy link
Author

dsxack commented Feb 21, 2020

@zombiezen thank you for response!

Would you mind if I try to increase the coverage of core Wire logic?

  • copyast.go: 54%
  • parse.go: 62%

Does it make sense for me to try? PR with that will be accepted?

@zombiezen
Copy link
Collaborator

In general, yes, I'm supportive of PRs that increase test coverage as long as the tests don't introduce additional maintenance burden (e.g. brittle or hard-to-understand tests).

Definitely would love to see more coverage for parse.go. You should be able to do that by using the existing test infrastructure and exercising more cases.

copyast.go would likely need its own new unit test structure. Off the cuff, I would think the best way to do this would be something like:

func TestCopyAST(t *testing.T) {
  tests := []struct{
    name string
    source string
  }{
    // ...
  }
  for _, test := range tests {
    // 1. Parse test.source using go/parser
    // 2. Call copyAST
    // 3. Use go-cmp to check that the returned AST is equivalent to the first
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA has been signed!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants