A place to document our standard operating procedures.
- Commit early, commit often.
- If you are working on a task that has an associated Jira ticket, please create a branch for the issue using the issue number as the name of the branch, for example, WP-100.
- Prefix your commits with the ticket number.
- Never prefix your commits with a
#
sign, this can cause the commit to be lost during rebase. - Use
git add -p
to stage individual hunks, and usegit diff --staged
to review before committing.
- Use the 6.x branch of drush from github
- Use ruby-install and chruby to manage ruby versions.
- Use bundler to manage rubygem versions.
- Use Display Suite when possible to alter the display of content
- Avoid use of template (.tpl.php) files whenever possible
- When overriding a template file, copy the original and rename as appropriate, and then commit it. Make the actual changes to the file in a separate commit.
- Favor preprocess hooks over theme functions over template files.
- Use
entity_metadata_wrapper()
whenever accessing field values on an entity. - Use
hook_ENTITYTYPE_view()
andhook_field_extra_fields()
to add non-field data to an entity - Prefer
hook_ENTITYTYPE_view_alter()
overhook_entity_view_alter()
if only one entity type is expected. - Prefer custom field formatters over custom alters when possible.