jumanjihouse/pre-commit-hooks

Error running pre-commit with shellcheck

matthewlynden opened this issue ยท 10 comments

When running pre-commit run --all-files on Mac OS X 10.15.7 (bash 5.1.4) with the following .pre-commit-config.yaml

an error is thrown

[ERROR] The hook shellcheckspecifiesadditional_dependenciesbut is using languagescript which does not install an environment. Perhaps you meant to use a specific language?

I have attempted to add additional configuration such as 'additional_dependencies' and 'language' but can't seem to get past this one. Is there some configuration missing that I cannot determine from the documentation?

yes, the same. Shellcheck is installed:

# which shellcheck
/usr/local/bin/shellcheck

I got this error message too after upgrading pre-commit from version 2.0.1 to 2.10.0.
I've reverted back and I'm fine for now.

Workaround until this is fixed: Overwrite the additional reps of the hook with an empty list:

 - repo: https://github.com/jumanjihouse/pre-commit-hooks
   rev: 2.1.4
   hooks:
     - id: shfmt
     - id: shellcheck
       additional_dependencies: []

Thanks for that, was driving me crazy to suddenly see this error ๐Ÿ˜„

Thanks for the workaround. I can confirm I don't see the error anymore with this fix.

askb commented

Seeing the same issue:

Look for any errors in the above output or in docs/_build/linkcheck/output.txt
pre-commit installed: appdirs==1.4.4,cfgv==3.2.0,distlib==0.3.1,filelock==3.0.12,identify==1.5.13,importlib-metadata==3.4.0,nodeenv==1.5.0,pre-commit==2.10.1,PyYAML==5.4.1,six==1.15.0,toml==0.10.2,typing-extensions==3.7.4.3,virtualenv==20.4.2,zipp==3.4.0
pre-commit run-test-pre: PYTHONHASHSEED='491141206'
pre-commit run-test: commands[0] | pre-commit run --all-files --show-diff-on-failure
[ERROR] The hook `shellcheck` specifies `additional_dependencies` but is using language `script` which does not install an environment.  Perhaps you meant to use a specific language?
ERROR: InvocationError for command /home/abelur/git/common-packer/.tox/pre-commit/bin/pre-commit run --all-files --show-diff-on-failure (exited with code 1)
__________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________
  docs: commands succeeded
  docs-linkcheck: commands succeeded
ERROR:   pre-commit: commands failed

I sent an email to the one jumanjiman has listed on his profile letting him know that there is a problem and open PRs with fixes. Also asked if he still has time or a desire to keep maintaining jumanjihouse/pre-commit-hooks, wants to find someone else to help, or would prefer users switch to using a fork as the main one.

I sent an email to the one jumanjiman has listed on his profile letting him know that there is a problem and open PRs with fixes. Also asked if he still has time or a desire to keep maintaining jumanjihouse/pre-commit-hooks, wants to find someone else to help, or would prefer users switch to using a fork as the main one.

Thanks @nightlark for the email...i had not seen any notifications from GH about the issue and PRs.

Thanks everybody for the fixes! I merged them into master.

If there are any more issues, please let me know.

-paul

ref: