Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC of assert formatting #6857

Closed
wants to merge 3 commits into from
Closed

POC of assert formatting #6857

wants to merge 3 commits into from

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Aug 24, 2023

Summary

This is a POC of formatting assertions where the left side is a can_omit_optional_parenthees expression
starting with a parenthesized expression and the right is a string.

This PR doesn't perfectly match black yet, but the similarity index aren't improving for any of our tested projects, which makes me question whether this is worth perusing.

I'm putting this up to get feedback on how important this formatting is. You can ignore the implementation and just look at the assert.py changes.

Test Plan

@MichaReiser
Copy link
Member Author

MichaReiser commented Aug 24, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Comment on lines +239 to +264
assert {
key1: value1,
key2: value2,
key3: value3,
key4: value4,
key5: value5,
key6: value6,
key7: value7,
key8: value8,
key9: value9,
} == expectedeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, "Not what we expected and the message is too long to fit in one lin"
Copy link
Member Author

@MichaReiser MichaReiser Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String should be parenthesized

Comment on lines +251 to +276
assert {
key1: value1,
key2: value2,
key3: value3,
key4: value4,
key5: value5,
key6: value6,
key7: value7,
key8: value8,
key9: value9,
} == expectedeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, "Not what we expected and the message is too long to fit in one lineeeeeeeeeeeeeeeee"
Copy link
Member Author

@MichaReiser MichaReiser Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String should be parenthesized

@github-actions

This comment was marked as outdated.

Base automatically changed from add-assert-test-cases to main August 25, 2023 05:51
@konstin konstin added the formatter Related to the formatter label Aug 25, 2023
@MichaReiser MichaReiser changed the base branch from main to allow-overflow September 19, 2023 09:09
Base automatically changed from allow-overflow to main September 20, 2023 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants