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

syntax: End brace of grouping expression not indented when part of multicommand && chain #1148

Open
reteps opened this issue Apr 7, 2025 · 1 comment

Comments

@reteps
Copy link
Contributor

reteps commented Apr 7, 2025

I have this formatted snippet produced by shfmt:

command \
    && command2 && {
    echo "This is grouped"
} \
    && command3

I would expect this to indent the grouped expression an extra level in this scenario:

command \
    && command2 && {
        echo "This is grouped"
    } \
    && command3

Alternately:

command \
    && command2 && {
    echo "This is grouped"
    } \
    && command3

It feels unexpected to me that the curly brace } is not indented in this scenario.

@reteps
Copy link
Contributor Author

reteps commented Apr 8, 2025

I noticed a similar issue in this scenario:

apt update \
    && apt install -y curl \
        git \
        pandoc \
        sqlite3 \
        sudo \
    && install.r bench \ 
data.table \
    devtools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant