2018-10-11 11:57:49 +00:00
# Style guides
2019-07-09 00:20:40 +00:00
1. [Ruby ](https://github.com/rubocop-hq/ruby-style-guide ).
2018-10-11 11:57:49 +00:00
Important sections include [Source Code Layout][rss-source] and
[Naming][rss-naming]. Use:
- multi-line method chaining style **Option A** : dot `.` on the second line
- string literal quoting style **Option A** : single quoted by default
2019-07-09 00:20:40 +00:00
1. [Rails ](https://github.com/rubocop-hq/rails-style-guide )
2018-10-11 11:57:49 +00:00
1. [Newlines styleguide][newlines-styleguide]
1. [Testing][testing]
1. [JavaScript styleguide][js-styleguide]
1. [SCSS styleguide][scss-styleguide]
2019-04-11 01:52:42 +00:00
1. [Shell commands (Ruby) ](../shell_commands.md ) created by GitLab
2018-10-11 11:57:49 +00:00
contributors to enhance security
1. [Database Migrations ](../migration_style_guide.md )
2019-07-09 00:20:40 +00:00
1. [Markdown ](https://cirosantilli.com/markdown-style-guide/ )
2018-10-11 11:57:49 +00:00
1. [Documentation styleguide ](../documentation/styleguide.md )
1. 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:_
1. Code should be written in [US English][us-english]
2019-02-06 16:10:12 +00:00
1. [Go ](../go_guide/index.md )
2019-03-16 21:49:59 +00:00
1. [Python ](../python_guide/index.md )
2019-07-24 02:52:01 +00:00
1. [Shell scripting ](../shell_scripting_guide/index.md )
2018-10-11 11:57:49 +00:00
2019-09-02 05:38:27 +00:00
## Checking the style and other issues
2018-10-11 11:57:49 +00:00
This is also the style used by linting tools such as
2019-07-09 00:20:40 +00:00
[RuboCop ](https://github.com/rubocop-hq/rubocop ) and [Hound CI ](https://houndci.com ).
2019-09-02 05:38:27 +00:00
You can run RuboCop by hand or install a tool like [Overcommit ](https://github.com/sds/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.
2018-10-11 11:57:49 +00:00
---
[Return to Contributing documentation ](index.md )
2019-06-28 01:15:36 +00:00
[rss-source]: https://github.com/rubocop-hq/ruby-style-guide/blob/master/README.adoc#source-code-layout
[rss-naming]: https://github.com/rubocop-hq/ruby-style-guide/blob/master/README.adoc#naming-conventions
2018-10-11 11:57:49 +00:00
[doc-guidelines]: ../documentation/index.md "Documentation guidelines"
[js-styleguide]: ../fe_guide/style_guide_js.md "JavaScript styleguide"
[scss-styleguide]: ../fe_guide/style_guide_scss.md "SCSS styleguide"
[newlines-styleguide]: ../newlines_styleguide.md "Newlines styleguide"
[testing]: ../testing_guide/index.md
[us-english]: https://en.wikipedia.org/wiki/American_English