Skip to content

Contributing Guidelines

fbis251 edited this page Aug 9, 2012 · 2 revisions

Contributing Guidelines

Coding Style Guidelines

In order to maintain a script of good quality and to reduce the number of commits devoted to fixing formatting, there are a number of coding style guidelines that should be followed.

  • Set your editor to output tabs as 4 spaces and NOT tab characters. This will help provide consistent indenting.
  • Keep extra lines and such to a minimum. If it can fit on one line, do it.
  • Separate each function by an empty line.
  • Script-wide variables & constants should be in all uppercase. Function local variables should be lowercase.

Commit Guidelines

One of the benefits of using Git is that a browsable history is maintained. In order for this to be helpful, however, the commits need to provide information about what they changed. It's also necessary that the history be kept as clean as possible too, so that there aren't too many commits that aren't providing real functionality changes.

  • Always, Always, ALWAYS rebase before pushing or submitting a pull request. Pull using git pull --rebase. Resolve any conflicts. This will ensure that there aren't an excessive number of merge commits and otherwise avoidable commits.
  • Remove any whitespace errors. Using a graphical git client such as gitg will reveal these in bright red.
  • Keep commits to one subject, meaning one commit should not combine changes that are not related to each other.
  • The first line of the commit should provide the subject of the commit. Describe the changes, preferably in under 80 characters.
  • The second line should be an empty line.
  • Subsequent lines should describe in as much detail as possible what the commit is changing and why the change is being made.
  • (optional) sign off your commit using Signed-off-by: Your Name <[email protected]>or by using git commit -s
Clone this wiki locally