For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
In below scripts a part of a multi-line command was commented out. However, the comment also disabled a backslash at the end of the line and therefore broke the multi-line command into two commands by accident.
#!/bin/bash
sed -i \
-e s/a/b/ \
# -e s/x/y/ \
/path/to/file
or
#!/bin/bash
sed -i -e s/a/b/ # -e s/x/y/ \
/path/to/file
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
It would be very nice if shellcheck gave a warning about trailing backslashes in comments. The warning could be similar to SC2215. Alternatively, SC2215 could be extended by these kind of mistakes.
For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
In below scripts a part of a multi-line command was commented out. However, the comment also disabled a backslash at the end of the line and therefore broke the multi-line command into two commands by accident.
or
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
It would be very nice if shellcheck gave a warning about trailing backslashes in comments. The warning could be similar to SC2215. Alternatively, SC2215 could be extended by these kind of mistakes.