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 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ## Contributing
  2. Thank you for your interest in go-toml! We appreciate you considering
  3. contributing to go-toml!
  4. The main goal is the project is to provide an easy-to-use TOML
  5. implementation for Go that gets the job done and gets out of your way –
  6. dealing with TOML is probably not the central piece of your project.
  7. As the single maintainer of go-toml, time is scarce. All help, big or
  8. small, is more than welcomed!
  9. ### Ask questions
  10. Any question you may have, somebody else might have it too. Always feel
  11. free to ask them on the [issues tracker][issues-tracker]. We will try to
  12. answer them as clearly and quickly as possible, time permitting.
  13. Asking questions also helps us identify areas where the documentation needs
  14. improvement, or new features that weren't envisioned before. Sometimes, a
  15. seemingly innocent question leads to the fix of a bug. Don't hesitate and
  16. ask away!
  17. ### Improve the documentation
  18. The best way to share your knowledge and experience with go-toml is to
  19. improve the documentation. Fix a typo, clarify an interface, add an
  20. example, anything goes!
  21. The documentation is present in the [README][readme] and thorough the
  22. source code. On release, it gets updated on [GoDoc][godoc]. To make a
  23. change to the documentation, create a pull request with your proposed
  24. changes. For simple changes like that, the easiest way to go is probably
  25. the "Fork this project and edit the file" button on Github, displayed at
  26. the top right of the file. Unless it's a trivial change (for example a
  27. typo), provide a little bit of context in your pull request description or
  28. commit message.
  29. ### Report a bug
  30. Found a bug! Sorry to hear that :(. Help us and other track them down and
  31. fix by reporting it. [File a new bug report][bug-report] on the [issues
  32. tracker][issues-tracker]. The template should provide enough guidance on
  33. what to include. When in doubt: add more details! By reducing ambiguity and
  34. providing more information, it decreases back and forth and saves everyone
  35. time.
  36. ### Code changes
  37. Want to contribute a patch? Very happy to hear that!
  38. First, some high-level rules:
  39. * A short proposal with some POC code is better than a lengthy piece of
  40. text with no code. Code speaks louder than words.
  41. * No backward-incompatible patch will be accepted unless discussed.
  42. Sometimes it's hard, and Go's lack of versioning by default does not
  43. help, but we try not to break people's programs unless we absolutely have
  44. to.
  45. * If you are writing a new feature or extending an existing one, make sure
  46. to write some documentation.
  47. * Bug fixes need to be accompanied with regression tests.
  48. * New code needs to be tested.
  49. * Your commit messages need to explain why the change is needed, even if
  50. already included in the PR description.
  51. It does sound like a lot, but those best practices are here to save time
  52. overall and continuously improve the quality of the project, which is
  53. something everyone benefits from.
  54. #### Get started
  55. The fairly standard code contribution process looks like that:
  56. 1. [Fork the project][fork].
  57. 2. Make your changes, commit on any branch you like.
  58. 3. [Open up a pull request][pull-request]
  59. 4. Review, potential ask for changes.
  60. 5. Merge. You're in!
  61. Feel free to ask for help! You can create draft pull requests to gather
  62. some early feedback!
  63. #### Run the tests
  64. You can run tests for go-toml using Go's test tool: `go test ./...`.
  65. When creating a pull requests, all tests will be ran on Linux on a few Go
  66. versions (Travis CI), and on Windows using the latest Go version
  67. (AppVeyor).
  68. #### Style
  69. Try to look around and follow the same format and structure as the rest of
  70. the code. We enforce using `go fmt` on the whole code base.
  71. ---
  72. ### Maintainers-only
  73. #### Merge pull request
  74. Checklist:
  75. * Passing CI.
  76. * Does not introduce backward-incompatible changes (unless discussed).
  77. * Has relevant doc changes.
  78. * Has relevant unit tests.
  79. 1. Merge using "squash and merge".
  80. 2. Make sure to edit the commit message to keep all the useful information
  81. nice and clean.
  82. 3. Make sure the commit title is clear and contains the PR number (#123).
  83. #### New release
  84. 1. Go to [releases][releases]. Click on "X commits to master since this
  85. release".
  86. 2. Make note of all the changes. Look for backward incompatible changes,
  87. new features, and bug fixes.
  88. 3. Pick the new version using the above and semver.
  89. 4. Create a [new release][new-release].
  90. 5. Follow the same format as [1.1.0][release-110].
  91. [issues-tracker]: https://github.com/pelletier/go-toml/issues
  92. [bug-report]: https://github.com/pelletier/go-toml/issues/new?template=bug_report.md
  93. [godoc]: https://godoc.org/github.com/pelletier/go-toml
  94. [readme]: ./README.md
  95. [fork]: https://help.github.com/articles/fork-a-repo
  96. [pull-request]: https://help.github.com/en/articles/creating-a-pull-request
  97. [releases]: https://github.com/pelletier/go-toml/releases
  98. [new-release]: https://github.com/pelletier/go-toml/releases/new
  99. [release-110]: https://github.com/pelletier/go-toml/releases/tag/v1.1.0