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

Suggest putting continuation indicators at the start of the line #2596

Closed
2 tasks done
l0b0 opened this issue Sep 25, 2022 · 1 comment
Closed
2 tasks done

Suggest putting continuation indicators at the start of the line #2596

l0b0 opened this issue Sep 25, 2022 · 1 comment

Comments

@l0b0
Copy link

l0b0 commented Sep 25, 2022

For new checks and feature suggestions

Here's a snippet that shows the problem:

#!/usr/bin/env bash
grep … | \
    sed … | \
    cut … || \
    echo

Here's what shellcheck currently says:

No issues detected!

Here's what I wanted or expected to see:

Put continuation indicators at the start of the line:

grep … \
    | sed … \
    | cut … \
    || echo

Rationale: It's easier to tell apart the various command separators if they are lined up and separate from other distracting syntax like \. Black does the same thing for Python.

@koalaman
Copy link
Owner

Check out shfmt which supports both styles (shfmt -bn for the latter), and auto-formats them better than ShellCheck could. For the most part, ShellCheck focuses on issues related to semantics and does not try to arbitrate style.

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

2 participants