You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CONTRIBUTING.md 2.7 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Want to contribute? Great: read the page (including the small print at the end).
  2. # Before you contribute
  3. As an individual, sign the [Google Individual Contributor License
  4. Agreement](https://cla.developers.google.com/about/google-individual) (CLA)
  5. online. This is required for any of your code to be accepted.
  6. Before you start working on a larger contribution, get in touch with us first
  7. through the issue tracker with your idea so that we can help out and possibly
  8. guide you. Coordinating up front makes it much easier to avoid frustration later
  9. on.
  10. # Development
  11. Make sure `GOPATH` is set in your current shell. The common way is to have
  12. something like `export GOPATH=$HOME/gocode` in your `.bashrc` file so that it's
  13. automatically set in all console sessions.
  14. To get the source code, run
  15. ```
  16. go get github.com/google/pprof
  17. ```
  18. To run the tests, do
  19. ```
  20. cd $GOPATH/src/github.com/google/pprof
  21. go test -v ./...
  22. ```
  23. When you wish to work with your own fork of the source (which is required to be
  24. able to create a pull request), you'll want to get your fork repo as another Git
  25. remote in the same `github.com/google/pprof` directory. Otherwise, if you'll `go
  26. get` your fork directly, you'll be getting errors like `use of internal package
  27. not allowed` when running tests. To set up the remote do something like
  28. ```
  29. cd $GOPATH/src/github.com/google/pprof
  30. git remote add aalexand git@github.com:aalexand/pprof.git
  31. git fetch aalexand
  32. git checkout -b my-new-feature
  33. # hack hack hack
  34. go test -v ./...
  35. git commit -a -m "Add new feature."
  36. git push aalexand
  37. ```
  38. where `aalexand` is your GitHub user ID. Then proceed to the GitHub UI to send a
  39. code review.
  40. # Code reviews
  41. All submissions, including submissions by project members, require review.
  42. We use GitHub pull requests for this purpose.
  43. The pprof source code is in Go with a bit of JavaScript, CSS and HTML. If you
  44. are new to Go, read [Effective Go](https://golang.org/doc/effective_go.html) and
  45. the [summary on typical comments during Go code
  46. reviews](https://github.com/golang/go/wiki/CodeReviewComments).
  47. Cover all new functionality with tests. Enable Travis on your forked repo,
  48. enable builds of branches and make sure Travis is happily green for the branch
  49. with your changes.
  50. The code coverage is measured for each pull request. The code coverage is
  51. expected to go up with every change.
  52. Pull requests not meeting the above guidelines will get less attention than good
  53. ones, so make sure your submissions are high quality.
  54. # The small print
  55. Contributions made by corporations are covered by a different agreement than the
  56. one above, the [Software Grant and Corporate Contributor License
  57. Agreement](https://cla.developers.google.com/about/google-corporate).