Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for hash indentation after line break
```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` What seems to be happening is that a line break is inserted between `{` and `keyN:`. `Layout/TrailingWhitespace` handles getting rid of the space remaining after `{`, but everything goes wrong in `Layout/FirstHashElementIndentation`. ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` It finds `key1:` in column 0, computes a column delta of 4, which it applies to the key and value lines, even though the value lines don't have the same indentation. ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` This repeats for `key2:`, which is not indented as much as it should be relative to its opening `{`, so the entire thing is indented by the column delta. ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` This continues to repeat for `key3:`, `key4:`, and `key5:`, respectively: ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` ```ruby def example { key1: { key2: { key3: { key4: { key5: :value } } } } } end ``` Every level is incorrectly corrected once for each of it's parents, and finally for itself, compounding the error.
- Loading branch information