You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatting is inconsistent between when the argument of a unary operator is a literal vs a variable. I'd prefer us to stick with ~~1 (removing the space, as we do with the variable case).
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
I would like a release if this problem is solved.
Options
Fantomas main branch at 2024-09-14T12:20:28Z - 06d86ad
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.
The text was updated successfully, but these errors were encountered:
Hi Patrick, thanks for bringing this up. I see that the style guide does indeed mention not to place a space. I will investigate whether there is a specific reason for this or if it's just a historical practice.
I will investigate whether there is a specific reason for this or if it's just a historical practice.
The space is needed (or parentheses are needed) if the numeric literal starts with a unary - or +, which is not currently reflected in the AST. (The unary - or + is, of course, reflected in the AST for non-literal expressions, e.g., -x.)
In the parens analyzer, I had to resort to looking at the source text:
Issue created from fantomas-online
(This is @Smaug123 but from the office.)
Code
Result
Problem description
The formatting is inconsistent between when the argument of a unary operator is a literal vs a variable. I'd prefer us to stick with
~~1
(removing the space, as we do with the variable case).Extra information
Options
Fantomas main branch at 2024-09-14T12:20:28Z - 06d86ad
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.
The text was updated successfully, but these errors were encountered: