Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Contributing

aaron schachter edited this page Nov 13, 2013 · 29 revisions

You'll be making commits and pushes against your local fork. All work being done should correspond to an open Github issue(s).

Where to write code

You should be making changes within the modules/dosomething and themes/dosomething directories in the root, not within anywhere the html directory, which is not tracked by git. The changes you make in these root folders will apply to the site because the html/profiles/dosomething/modules/dosomething and html/profiles/dosomething/themes/dosomething directories symlink to the respective folders on root from which you should be working.

Using git rebase to keep up to date

  • Add the main repo as an upstream remote to keep your fork up to date.

    • git remote add upstream git@github.com:DoSomething/dosomething.git
  • Regularly rebase upstream to keep up to date:

    • git fetch
    • git rebase upstream/dev
    • git push origin dev

Writing SimpleTests

Make sure your instance passes tests locally and you create new tests for each function you write.

  • Write your functions knowing each function should have a unit test associated with it.
    • Split your code out into smaller functions to easily write unit tests for each function.

Coder

Lastly, make sure your changes pass Coder.

Open pull request against dosomething/dev

When your changes are ready to go, open a pull request against the dev branch in the main repo.

Coding standards

The Drupal coding standards apply everywhere. Many editors have helper plug-ins.

If those standards don't cover your situation, document additional standards in this wiki.

Documentation

All modules and functions should include comments that document why and how the code is used, as per Drupal's API documentation standards.

Every new feature should have an issue for writing documentation for the work done. Because this documentation is included in the comments of the codebase, the pull request which adds the documentation should reference the corresponding issue to resolve it.

Clone this wiki locally