Style guides

  1. Ruby. Important sections include Source Code Layout and Naming. Use:
  2. multi-line method chaining style Option A: dot . on the second line
  3. string literal quoting style Option A: single quoted by default
  4. Rails
  5. Newlines styleguide
  6. Testing
  7. JavaScript styleguide
  8. SCSS styleguide
  9. Shell commands (Ruby) created by GitLab contributors to enhance security
  10. Database Migrations
  11. Markdown
  12. Documentation styleguide
  13. Interface text should be written subjectively instead of objectively. It should be the GitLab core team addressing a person. It should be written in present time and never use past tense (has been/was). For example instead of prohibited this user from being saved due to the following errors: the text should be sorry, we could not create your account because:
  14. Code should be written in US English
  15. Go
  16. Python
  17. Shell scripting

Checking the style and other issues

This is also the style used by linting tools such as RuboCop and Hound CI. You can run RuboCop by hand or install a tool like Overcommit to run it for you. Overcommit will automatically run the configured checks (like Rubocop) on every modified file before commit. You can use the example overcommit configuration found in .overcommit.yml.example as a quickstart. This saves you time as you don't have to wait for the same errors to be detected by the CI.


Return to Contributing documentation