diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-12 15:31:40 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-13 11:57:23 +0200 |
commit | be071be3cf47660830d062e3faa57e02bc9ef207 (patch) | |
tree | 85a94302cd7b1e114ec62b057be77a41211a107b | |
parent | f7be904afa2edf731e87f1f60918c0d82234eff4 (diff) | |
download | gitlab-ce-rc-document-preferred-array-syntax.tar.gz |
Document our preference for array literals until we enable a Coprc-document-preferred-array-syntax
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | CONTRIBUTING.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c77dcd96a7d..47359a3afd6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -414,6 +414,19 @@ merge request: [Naming][rss-naming]. Use: - multi-line method chaining style **Option B**: dot `.` on previous line - string literal quoting style **Option A**: single quoted by default + - Array `%` literals: Prefer `[]` as delimiters for all `%` literals since + the `[` and `]` are already used for non-literal arrays, e.g. + + ```ruby + # good + ['a', 'b', 'c'] + %w[one two three] + %i[one two three] + + # bad + %w(one two three) + %i{one two three} + ``` 1. [Rails](https://github.com/bbatsov/rails-style-guide) 1. [Newlines styleguide][newlines-styleguide] 1. [Testing](doc/development/testing.md) |