Skip to content

Latest commit

 

History

History
128 lines (85 loc) · 4.13 KB

CONTRIBUTING.md

File metadata and controls

128 lines (85 loc) · 4.13 KB

Contributing to Gopherize

First off, thanks for taking the time to contribute!! ❤️

Quick Reference

I want to...

add an exercise! ➡️ read this and then open a Pull Request

update an outdated exercise! ➡️ open a Pull Request

report a bug! ➡️ open an Issue

fix a bug! ➡️ open a Pull Request

implement a new feature! ➡️ open an Issue to discuss it first, then a Pull Request

Working on the source code

cmd/root.go contains a simple gopherize CLI that connects to most of the other source files.

Adding an exercise guidelines

  • The first step is to add the exercise! Name the file exercise/yourTopic/main.go, make sure to put in some helpful links, and link to sections of the book in exercises/yourTopic/README.md. If you have multiple exercises, you may name the file exercise/yourTopic/yourTopicN/main.go. (For example: exercise/go-routine/chapter1/main.go)
  • It's encourage to create a README.md for each topic. The README.md should have an overview about the topic.
  • When designing your exercise, it is encourage to write some comment about the exercise that the your are going to work on. Place these comment at the top of your code just after package. You can also include some tips/hint which might helps the user to kickstart.
  • After you had done designing your exercise, remember to add // I AM NOT DONE comment on top of the first function in your file.
  • Then add the exercise metadata to the exercise.yaml file. Add the metadata for your exercise in the correct order in the exercises array. If you are unsure of the correct ordering, add it at the bottom and ask in your pull request. The exercise metadata should contain the following:
  ...
+ - name: helloworld
+   type: compile
+   file: exercise/hello_world/main.go
  ...
  • Finally, you can test your exercise using gopherize run <your-exercise-name>

That's all! Feel free to put up a pull request.

Issues

You can open an issue here. If you're reporting a bug, please include the output of the following commands:

  • go version
  • ls -la
  • Your OS name and version

Pull Requests

Opening a pull request is as easy as forking the repository and committing your changes. There's a couple of things to watch out for:

Write correct commit messages

We follow the Conventional Commits specification. This means that you have to format your commit messages in a specific way. Say you're working on adding a new exercise called foobar1.go. You could write the following commit message:

feat: add foobar1.go exercise

If you're just fixing a bug, please use the fix type:

fix(verify): make sure verify doesn't self-destruct

The scope within the brackets is optional, but should be any of these:

  • installation (for the installation script)
  • cli (for general CLI changes)
  • verify (for the verification source file)
  • watch (for the watch functionality source)
  • run (for the run functionality source)
  • EXERCISENAME (if you're changing a specific exercise, or set of exercises, substitute them here)

When the commit also happens to close an existing issue, link it in the message body:

fix: update foobar

closes #101029908

If you're doing simple changes, like updating a book link, use chore:

chore: update exercise1.go book link

If you're updating documentation, use docs:

docs: add more information to Readme

If, and only if, you're absolutely sure you want to make a breaking change (please discuss this beforehand!), add an exclamation mark to the type and explain the breaking change in the message body:

fix!: completely change verification

BREAKING CHANGE: This has to be done because lorem ipsum dolor

Pull Request Workflow

Once you open a Pull Request, it may be reviewed or labeled (or both) until the maintainers accept your change. Please be patient, it may take some time for this to happen!