jumanjihouse / pre-commit-hooks

git pre-commit hooks that work with http://pre-commit.com/
MIT License
114 stars 52 forks source link

Error running pre-commit with shellcheck #82

Closed matthewlynden closed 3 years ago

matthewlynden commented 3 years ago

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 hookshellcheckspecifiesadditional_dependenciesbut is using languagescriptwhich 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?

antonlisovenko commented 3 years ago

yes, the same. Shellcheck is installed:

# which shellcheck
/usr/local/bin/shellcheck
tbugfinder commented 3 years ago

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.

tbugfinder commented 3 years ago

Might indeed not be applicable to scripts.

https://pre-commit.com/index.html#config-additional_dependencies

neunkasulle commented 3 years ago

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: []
richtong commented 3 years ago

Thanks for that, was driving me crazy to suddenly see this error :smile:

matthewlynden commented 3 years ago

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

askb commented 3 years ago

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
nightlark commented 3 years ago

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.

richtong commented 3 years ago

Great!

Sent via Superhuman iOS ( https://sprh.mn/?vip=rich@tongfamily.com )

On Tue, Feb 16 2021 at 16:54, Ryan Mast < notifications@github.com > wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/jumanjihouse/pre-commit-hooks/issues/82#issuecomment-780216613 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AANTCR5XPJOAVOZCPYHJDZLS7MHTHANCNFSM4WX5WDEA ).

jumanjiman commented 3 years ago

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: