Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running pre-commit with shellcheck #82

Closed
matthewlynden opened this issue Jan 28, 2021 · 10 comments
Closed

Error running pre-commit with shellcheck #82

matthewlynden opened this issue Jan 28, 2021 · 10 comments

Comments

@matthewlynden
Copy link

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?

@antonlisovenko
Copy link

yes, the same. Shellcheck is installed:

# which shellcheck
/usr/local/bin/shellcheck

@tbugfinder
Copy link

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
Copy link

Might indeed not be applicable to scripts.

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

@neunkasulle
Copy link

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
Copy link

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

@matthewlynden
Copy link
Author

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

@askb
Copy link

askb commented Feb 17, 2021

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
Copy link

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
Copy link

richtong commented Feb 17, 2021 via email

@jumanjiman
Copy link
Member

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:

ghickman added a commit to opensafely-core/cohort-extractor that referenced this issue Feb 25, 2021
A change in pre-commit caused this bug in the shellcheck
pre-commit-hooks repo:

jumanjihouse/pre-commit-hooks#82

Fixed in 2.1.5
ghickman added a commit to opensafely-core/cohort-extractor that referenced this issue Feb 26, 2021
A change in pre-commit caused this bug in the shellcheck
pre-commit-hooks repo:

jumanjihouse/pre-commit-hooks#82

Fixed in 2.1.5
ghickman added a commit to opensafely-core/cohort-extractor that referenced this issue Mar 1, 2021
A change in pre-commit caused this bug in the shellcheck
pre-commit-hooks repo:

jumanjihouse/pre-commit-hooks#82

Fixed in 2.1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants