Wrap dict literal items to a new line
Answered
Hi,
Is there's a way when reformatting my code using ⌥+⌘+L to have a given dictionary literal:
user = {'name': 'John', 'last_name': 'Doe', 'email': 'jdoe@gmail.com'}
To look like this after reformatting:
user = {'name': 'John',
'last_name': 'Doe',
'email': 'jdoe@gmail.com'}
Trying to achieve this result by configuring dictionary literal from Settings > Editor > Code Style > Python > dictionary literals it only gave me unwanted results such as adding a new line at the beginning of the first dict item.
Example for unwanted result:
user = { <<< notice the new line after the '{'
'name': 'John',
'last_name': 'Doe',
'email': 'jdoe@gmail.com'}
How can this be achieved?
Please sign in to leave a comment.
Setting this option should do the trick

thanks Sergey Karpov!
Well, the unwanted result (with the new line after the '{' ) was given with 'Wrap always'. Even though 'New line after '{' was not checked.