Skip to content

Zig fmt does not fix whitespace on one side of an operator #11384

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

Closed
silversquirl opened this issue Apr 5, 2022 · 2 comments
Closed

Zig fmt does not fix whitespace on one side of an operator #11384

silversquirl opened this issue Apr 5, 2022 · 2 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@silversquirl
Copy link
Contributor

Zig Version

0.10.0-dev.1558+2af69710a

Steps to Reproduce

Try to run zig fmt on the following code:

pub fn main() void {
    a+ b;
}

Expected Behavior

The code should be reformatted to:

pub fn main() void{
    a + b;
}

Actual Behavior

<stdin>:2:6: error: binary operator `+` has whitespace on one side, but not the other.
    a+ b;
     ^

Probably caused by the implementation of #7399. Ideally this would be a compile error, but not a syntax error.

@silversquirl silversquirl added the bug Observed behavior contradicts documented or intended behavior label Apr 5, 2022
@Vexu
Copy link
Member

Vexu commented Apr 5, 2022

Duplicate of #11261.

@Vexu Vexu closed this as completed Apr 5, 2022
@jibal
Copy link

jibal commented Apr 14, 2022

This is intended behavior: #7399 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

3 participants