Skip to content
Joachim Ansorg edited this page Oct 31, 2022 · 2 revisions

You need at least one command here. Use true; as a no-op.

Problematic code:

submitbug() {
  # TODO: Implement me
}

Correct code:

submitbug() {
  # TODO: Implement me
  true
}

Rationale:

ShellCheck found an empty code block. This could be an empty function as shown, a loop with an empty body, or similar.

Sh/bash does not allow empty code blocks. Insert at least one command. If you don't want the block to do anything, true (aka :) is a good no-op.

Exceptions:

None

Related resources:

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally