Skip to content

Instantly share code, notes, and snippets.

@marcelovani
Last active May 18, 2016 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelovani/fdf6aa0c37637f7da94b1e06ab55d122 to your computer and use it in GitHub Desktop.
Save marcelovani/fdf6aa0c37637f7da94b1e06ab55d122 to your computer and use it in GitHub Desktop.

Contributing

Please send a patch as a pull request against the branch develop. After a successful build this branch will be merged to master.

For Drupal modules, please follow these guidelines:

Coding standards

Dreditor mostly follows Drupal's JavaScript and CSS coding standards. Quick summary:

  • Two spaces for indentation. No tabs. Use "\t" if you need a literal tab character in a string.
  • Exception: Markdown uses 4 spaces for indentation for maximum parser compatibility.
  • No trailing white-space.
  • Exception: Markdown uses 2 trailing spaces to enforce a linebreak.
  • Don't go overboard with white-space.
  • No more than one assignment per var statement.
  • Delimit strings with single-quotes ', not double-quotes ".
  • Prefer if and else over non-obvious ? : ternary operators and complex || or && expressions.
  • Comment your code. Place comments before the line of code, not at the end of the line.
  • When in doubt, stay consistent. Follow the conventions you see in the existing code.

Automated testing

When submitting a pull request, Travis CI will automatically…

Perform an automated build. JSHint all code to check for errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment