interactive-coding-challenges/CONTRIBUTING.md

98 lines
5.5 KiB
Markdown
Raw Normal View History

2015-07-03 10:58:12 +08:00
Contributing
============
Contributions are welcome!
**Please carefully read this page to make the code review process go as smoothly as possible and to maximize the likelihood of your contribution being merged.**
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
## Bug Reports
2015-07-03 10:58:12 +08:00
2015-07-05 19:49:33 +08:00
For bug reports or requests [submit an issue](https://github.com/donnemartin/interactive-coding-challenges/issues).
2015-07-03 10:58:12 +08:00
## Pull Requests
2015-07-05 19:49:33 +08:00
**Please follow the general [Repo Structure](https://github.com/donnemartin/interactive-coding-challenges#repo-structure) and [Notebook Structure](https://github.com/donnemartin/interactive-coding-challenges#notebook-structure) before submitting your pull request.**
2015-07-03 10:58:12 +08:00
The preferred way to contribute is to fork the
[main repository](https://github.com/donnemartin/interactive-coding-challenges) on GitHub.
1. Fork the [main repository](https://github.com/donnemartin/interactive-coding-challenges). Click on the 'Fork' button near the top of the page. This creates a copy of the code under your account on the GitHub server.
2. Clone this copy to your local disk:
$ git clone git@github.com:YourLogin/interactive-coding-challenges.git
$ cd interactive-coding-challenges
3. Create a branch to hold your changes and start making changes. Don't work in the ``master`` branch!
$ git checkout -b my-feature
4. Work on this copy on your computer using Git to do the version control. When you're done editing, run the following to record your changes in Git:
$ git add modified_files
$ git commit
5. Push your changes to GitHub with:
$ git push -u origin my-feature
6. Finally, go to the web page of your fork of the interactive-coding-challenges repo and click 'Pull request' to send your changes for review.
**Please submit one pull request per challenge.**
2015-07-04 08:10:59 +08:00
### GitHub Pull Requests Docs
If you are not familiar with pull requests, review the [pull request docs](https://help.github.com/articles/using-pull-requests/).
### Notebook Installation
2015-07-03 10:58:12 +08:00
2015-07-05 19:49:33 +08:00
Refer to [Accessing the Challenges](https://github.com/donnemartin/interactive-coding-challenges#accessing-the-challenges), [Notebook Installation](https://github.com/donnemartin/interactive-coding-challenges#notebook-installation), and [Nose Installation](https://github.com/donnemartin/interactive-coding-challenges#nose-installation) to set up your local environment.
2015-07-04 08:10:59 +08:00
### Adding New Solutions to Existing Challenges
Challenges have multiple solutions. If adding new solutions to existing challenges:
* Add your algorithm discusion and code solution to the existing notebook
* Update the unit test to include your solution
2015-07-03 10:58:12 +08:00
* Verify your code passes the unit tests
### Adding New Challenges
2015-07-04 08:10:59 +08:00
The README contains several sample challenges that are not yet implemented.
* The sample challenges are only suggestions, please do not limit yourself to only these topics
* Feel free to send pull requests on different challenges or categories of challenges
2015-07-03 10:58:12 +08:00
* Try to keep the "Challenge" title relatively short and expand on the details within the notebook
2015-07-05 19:49:33 +08:00
* Review the [Repo Structure](https://github.com/donnemartin/interactive-coding-challenges#repo-structure) and [Notebook Structure](https://github.com/donnemartin/interactive-coding-challenges#notebook-structure) sections
* Check out the [template challenge and solution notebooks](https://github.com/donnemartin/interactive-coding-challenges/tree/master/templates) to help you get started
2015-07-03 10:58:12 +08:00
| Challenge | Static Notebooks |
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
2015-07-05 19:49:33 +08:00
| Check if a number is prime | [Contribute](https://github.com/donnemartin/interactive-coding-challenges#contributing)│[Contribute](https://github.com/donnemartin/interactive-coding-challenges#contributing) |
| Generate a list of primes | [Contribute](https://github.com/donnemartin/interactive-coding-challenges#contributing)│[Contribute](https://github.com/donnemartin/interactive-coding-challenges#contributing) |
2015-07-03 10:58:12 +08:00
Update the list of challenges in the README so we can enjoy your challenge!
2015-07-04 08:10:59 +08:00
### Update Notebook Author(s)
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
When contributing to a notebook, update the notebook author(s):
<small><i>This notebook was prepared by [Joe](https://github.com/) and [Jane](https://github.com/). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).</i></small>
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
### Maintain Consistent Style
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
Please refer to the style of existing notebooks to help maintain consistency. A consistently themed collection of notebooks will help users more seamlessly transition from challenge to challenge.
2015-07-03 10:58:12 +08:00
Review the following [style guide](https://google.github.io/styleguide/pyguide.html).
2015-07-12 03:45:51 +08:00
Review [PEP8](https://www.python.org/dev/peps/pep-0008/) and use a [validator](http://pep8online.com/).
*Note: IPython Notebook doesn't seem to properly handle a blank line at the end of a code cell when writing the cell's contents to a file, as referenced in this [issue](https://github.com/ipython/ipython/issues/8626). Notebook cells currently do not have a blank line at the end of each code cell.*
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
### Contributions in Languages Other than Python
2015-07-03 10:58:12 +08:00
2015-07-04 08:10:59 +08:00
Feel free to share your thoughts on how we could best approach adding challenges in other [supported languages](https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages):
* Repo structure
* README challenge list
* Installation instructions
* Etc
2015-07-03 10:58:12 +08:00
Share your thoughts in this [issue](https://github.com/donnemartin/interactive-coding-challenges/issues/3).