-
Notifications
You must be signed in to change notification settings - Fork 14
New Feature Guide
So you're all ready to write some new code for habitat? Great!
First, check the feature you want to write is a story on the tracker: http://www.pivotaltracker.com/projects/112268 (If you don't have member access to the tracker, just ask and an account can be set up).
If the feature isn't already a story, add a new one. Just press 'a' or click Add Story, give it a brief description, assign points (usually one or two depending on how awesome your feature is!) and then Start it.
Meanwhile, since we're following nvie's gitflow model (here), you now create a new branch from develop in your local git repository:
$ git checkout develop
$ git checkout -b my-new-feature
Switched to a new branch 'my-new-feature'
$ git status
# On branch my-new-feature
nothing to commit (working directory clean)
Write your code! The model to follow here is:
1: Tests!
Writing tests first is a Good Thing. We're using nose for python and jasmine for javascript. You can check out existing code to get an idea, but essentially tests go in the tests/ subdirectory from wherever your code is, in files named test_whatever.py/js and contain functions like test_can_perform_magic().
2: Code!
Next, write code that makes the tests pass. Be sure to run the tests often with $ nosetests
!
3: Commit!
This part's easy. $ git add files-that-changed.py; git commit -m "++magic"
.
So your new code is written, it passes your tests (of course), and it's ready to go?
- Close the story on Pivotal
- Open a pull request from me/my-new-feature to ukhas/develop
- Deliver the story on Pivotal
- Wait for someone to pull it into ukhas! Be prepared for discussion and updates on the pull request.