Skip to content

Commit

Permalink
Add an example of compact left braces to SpaceInsideHashLiteralBraces
Browse files Browse the repository at this point in the history
  • Loading branch information
rrosenblum authored and bbatsov committed Jan 11, 2019
1 parent 8e38f13 commit b2ce7b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ module Layout
#
# # bad
# h = { a: { b: 2 } }
# foo = { { a: 1 } => { b: { c: 2 } } }
#
# # good
# h = { a: { b: 2 }}
#
# foo = {{ a: 1 } => { b: { c: 2 }}}
#
# @example EnforcedStyleForEmptyBraces: no_space (default)
# # The `no_space` EnforcedStyleForEmptyBraces style enforces that
Expand Down
2 changes: 2 additions & 0 deletions manual/cops_layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -4028,9 +4028,11 @@ h = {a: 1, b: 2}

# bad
h = { a: { b: 2 } }
foo = { { a: 1 } => { b: { c: 2 } } }

# good
h = { a: { b: 2 }}
foo = {{ a: 1 } => { b: { c: 2 }}}
```
#### EnforcedStyleForEmptyBraces: no_space (default)
Expand Down

0 comments on commit b2ce7b6

Please sign in to comment.