Project

General

Profile

Actions

Feature #10528

open

Allow line breaks instead of commas in arrays, hashes, argument lists, etc.

Added by alexeymuranov (Alexey Muranov) about 10 years ago. Updated almost 3 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:66371]

Description

Since the seemingly reasonable proposal #8956 has been rejected because it "diverged so far from the original", i will dare to propose another version here.

I suggest to automatically convert line breaks inside parentheses (...), inside "hashy" braces {...}, inside brackets [...], and inside block argument lists |...|, if they are not preceded with a comma and skipping empty space, into a comma, while all other line breaks that are not preceded with a semicolon into a semicolon (skipping empty lines). Unless, of course, the line break is preceded with \ or followed by a dot ..

I would be possible to write then:

todo = [ 'shopping'
         'cinema'
         'restaurant' ]

rules = { 'evil' => 'bad'
          'kind' => 'good' }

Related issues 1 (1 open0 closed)

Has duplicate Ruby master - Misc #15431: Hashes and arrays should not require commas to seperate values when using new linesOpenActions

Updated by alexeymuranov (Alexey Muranov) about 10 years ago

I forgot to mention other usual cases when lines should be implicitly continued: after a dot, after an operator symbol, etc.

Actions #2

Updated by mame (Yusuke Endoh) almost 6 years ago

  • Has duplicate Misc #15431: Hashes and arrays should not require commas to seperate values when using new lines added
Actions #3

Updated by hsbt (Hiroshi SHIBATA) almost 3 years ago

  • Project changed from 14 to Ruby master
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0