Skip to content

shell-check-stdin doesn't properly flag shell-check errors #67

Description

@tomasohara

The shell-check-stdin doesn't properly flag shell-check errors:

$ shell-check-stdin
Enter snippet lines and then ^D
{
   # pre-init: NOTEBOOK="benchmark_all_models.ipynb"
   notebook="${NOTEBOOK:-notebook.ipynb}"
   base="$(basename $notebook .ipynb)";
   TMP=_temp export-notebook benchmark_all_models.ipynb
   PYTHON="command ipython" IPYTHONDIR=$TMP/ipython run-python-script "_temp/$base.py"
}
^D
In - line 4:
   base="$(basename $notebook .ipynb)";
                    ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
   base="$(basename "$notebook" .ipynb)";

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
shellcheck OK

The error status code is not being recognized:

$ shellcheck _run-benchmark-all-snippet-16aug24.sh

In _run-benchmark-all-snippet-16aug24.sh line 1:
# pre-init: NOTEBOOK="benchmark_all_models.ipynb"
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.


In _run-benchmark-all-snippet-16aug24.sh line 3:
base="$(basename $notebook .ipynb)";
                 ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
base="$(basename "$notebook" .ipynb)";

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
$ echo $?
1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions