Skip to content

Generated dicts also have keys and values for rules to apply#1044

Merged
bwendling merged 1 commit into
google:mainfrom
alexey-pelykh:feature/generated-dicts-also-have-keys-and-values
Jan 4, 2023
Merged

Generated dicts also have keys and values for rules to apply#1044
bwendling merged 1 commit into
google:mainfrom
alexey-pelykh:feature/generated-dicts-also-have-keys-and-values

Conversation

@alexey-pelykh

@alexey-pelykh alexey-pelykh commented Dec 26, 2022

Copy link
Copy Markdown
Contributor

The general idea:

If

responseDict = {'childDict': {'spam': 'eggs'}}

is formatted as

responseDict = {
    'childDict': {
        'spam': 'eggs'
    }
}

so should

generatedDict = {x: x for x in 'value'}

be formatted as

generatedDict = {
    x: x for x in 'value'
}

assuming force_multiline_dict is enabled. Also allows to achieve the following format if split_before_dict_set_generator is enabled:

generatedDict = {
    x: x
    for x in 'value'
}

@bwendling

Copy link
Copy Markdown
Member

Thanks! Please add a comment to CHANGELOG.

@alexey-pelykh
alexey-pelykh force-pushed the feature/generated-dicts-also-have-keys-and-values branch from 80ce00c to e6ca1c7 Compare January 4, 2023 04:53
@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

@bwendling not sure that done correctly, yet done nonetheless

@bwendling
bwendling merged commit bb2baba into google:main Jan 4, 2023
@alexey-pelykh
alexey-pelykh deleted the feature/generated-dicts-also-have-keys-and-values branch January 4, 2023 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants