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
syntax: printer breaks certain arithmetic expressions #987
Comments
Thanks for reporting - this does indeed look like a bug. Happy to review a PR, as this one shouldn't be hard to fix. |
I realised in zsh, the expression like this would be treated as if (($+commands[exa])); then |
I believe this is only true for interactive shells since this syntax triggers history expansion. It's perfectly fine to use it from within a script by the very default, unless you explicitly enable |
By default, shfmt removes brackets within parentheses, but this breaks certain kinds of expressions.
For example:
shfmt will format this into:
The text was updated successfully, but these errors were encountered: