Skip to content

bash/unused-functions

Finds shell functions no script in the scope calls.

Part of the bash configuration, at the recommended level. It runs at the commit stage, once per scope. gspot runs this check itself.

A function that nothing calls still costs reading and upkeep, and it hides which code runs.

Delete the function. For a required hook entry point, run gspot ignore bash/unused-functions --paths <file> --reason <why>.

A private function _orphan that no script calls reports a finding. Delete it, or record a hook that needs it with gspot ignore and a reason.

Turn it off for some files, with a reason:

gspot ignore bash/unused-functions --paths "<glob>" --reason "<why>"