Skip to content

Instantly share code, notes, and snippets.

@fibo
Last active February 10, 2016 11:32
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 fibo/a3eea0078283b44bb36e to your computer and use it in GitHub Desktop.
Save fibo/a3eea0078283b44bb36e to your computer and use it in GitHub Desktop.

Coding Guidelines

README Driven Development

From Tom Preston-Werner's article,

Write your Readme first.

Create a README.md in your repository root folder and write there all information needed to setup, install, develop the related software. Include also links and references to external sources but try to keep the information auto consistent as much as possible, that is

Keep in your Readme everything you need to know quickly about the project.

Consider put a README.md also in sub folders (for instance, like this file) where it is needed, cause GitHub site will render them.

Use Markdown

Markdown is easy to use and has great benefits, use it to document your project. Take a look to Mastering Markdown GitHub Guide.

Use git branches

Learn how to use git branches, try to avoid working on master branch. Read the this short branch tutorial.

Editor config

Use EditorConfig to mantain a consistent coding style between different editors. To get started, add an .editorconfig at the root of your repo with the following sample content

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.{js,json}]
indent_style = space
indent_size = 2

[*.{sql}]
indent_style = tab

Check here if your editor supports EditorConfig natively (for example WebStorm) or you need to install a plugin (for example editorconfig-vim or editorconfig-sublime).

Find last version of this document here.

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