pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Previously woking hook fails since local executable can't be found #165

Closed lorenzwalthert closed 1 year ago

lorenzwalthert commented 1 year ago

My local R hook that worked on pre-commit.ci and works locally with entry_point: Rscript inst/hooks/local/hooks-config-to-inst.R does apparently not work anymore, as the corresponding executable in the cloned repo is not found anymore: https://results.pre-commit.ci/run/github/186313720/1675013388.2JJTn3qtTbK7thcVWBMD5g. Any ideas why?

Fatal error: cannot open file '/pc/clone/a2Kw-5FAQIyJz2B3MzJ-fg/inst/hooks/local/hooks-config-to-inst.R': No such file or directory

Locally, I managed to get the hook to pass with pre-commit run --all-files.

asottile commented 1 year ago

hmmm I might've broken this recently -- what version of pre-commit do you have locally?

lorenzwalthert commented 1 year ago

pre-commit 2.20.0

asottile commented 1 year ago

ah I bet I broke this in pre-commit 3.0, I did have to change some stuff around with how R worked and I might've overlooked something :(

lorenzwalthert commented 1 year ago

No problem. How can I help you fix it?

asottile commented 1 year ago

I probably have enough information to fix this -- can you open an issue on pre-commit/pre-commit?

lorenzwalthert commented 1 year ago

With pre-commit 3.0.1, I get all hooks passing locally too. So I am not sure what issue description you expect if I open one in pre-commit/pre-commit?

asottile commented 1 year ago

hmmmm they seem to be failing for me! but I know how to fix it:

$ pre-commit  run --all-files
[INFO] Initializing environment for local:magrittr,purrr,rlang,yaml.
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Ordered regex pattern for spell-check exclusion..........................Failed
- hook id: spell-check-ordered-exclude
- exit code: 2

Fatal error: cannot open file '/home/asottile/.cache/pre-commit/repo6mrxh59i/inst/hooks/local/spell-check-ordered-exclude.R': No such file or directory
asottile commented 1 year ago

https://github.com/pre-commit/pre-commit/pull/2728 should fix it either way -- so I don't need the issue

lorenzwalthert commented 1 year ago

Ah now it also fails for me, must have had wrong executable or repo 🙃.

asottile commented 1 year ago

pre-commit 3.0.2 is out now and pre-commit.ci is updated to have that too -- thanks again for the report!

lorenzwalthert commented 1 year ago

Can confirm that it works now, thanks for releasing the fix near-immediately. 👍