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

Grainfmt: Formatting causes math operations to change #1374

Closed
spotandjake opened this issue Jul 27, 2022 · 1 comment · Fixed by #1385
Closed

Grainfmt: Formatting causes math operations to change #1374

spotandjake opened this issue Jul 27, 2022 · 1 comment · Fixed by #1385
Assignees
Labels
bug grainfmt Issues related to the Grain formatter

Comments

@spotandjake
Copy link
Member

I have format on save enabled on the grain extension and when i was trying to run tests for #1373 the formatter was reformatting the test files in a way that caused the tests to fail.

image
The above image shows the tests running fine when the extension is uninstalled and it cannot format.
image
When the formater is run it makes the changes above.
image
which causes the tests to fail.

i think it might be because before it is formated it is treated as 4 / a fraction. and after formatting it is treated as repeated division.

@phated phated added bug grainfmt Issues related to the Grain formatter labels Jul 27, 2022
@phated phated changed the title Using The Grain Formatter Is Causing Code Behavour To Change Grainfmt: Formatting causes math operations to change Jul 27, 2022
@marcusroberts marcusroberts self-assigned this Jul 29, 2022
@marcusroberts
Copy link
Member

Just to capture in text

assert 4 / (2/3) == 6

is formatted to

assert 4 / 2 / 3 == 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug grainfmt Issues related to the Grain formatter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants