Pre-commit: Debugging new hook

Created on 6 Sep 2017  ยท  3Comments  ยท  Source: pre-commit/pre-commit

Hi!
I'm trying to develop a new pre-commit hook for SVGO:
https://github.com/svg/svgo
https://github.com/hectorv/mirrors-svgo
I used pre-commit-mirror-maker to create it.

My .pre-commit-config.yaml currently looks like this:

---
-   repo: https://github.com/hectorv/mirrors-svgo.git
    sha: v0.6.6
    hooks:
    -   id: svgo

Unfortunately I'm getting this Unknown argument messages that I don't know where to start debugging:

โฏ pre-commit run --all-files svgo
svgo.....................................................................Failed
hookid: svgo

Unknown argument: main/client/static/images/study/android phone + shield copy.svg
Unknown argument: main/client/static/images/score/037.svg
Unknown argument: main/client/static/images/test/click_allow_arrow.svg
Unknown argument: main/client/static/images/cms_splash/globe.svg
Unknown argument: main/client/static/images/splash-sprite3.svg
Unknown argument: main/client/static/images/score/053.svg

I'm guessing I haven't properly configured the way pre-commit passes arguments to SVGO, but I'm not sure how to proceed.
Any ideas? Thanks!

question

All 3 comments

Here's the documentation on how pre-commit passes arguments.

My shot-in-the-dark guess is that svgo currently doesn't support passing multiple arguments at a time. It seems there's already an open issue for a similar thing!

I'd suggest writing a pull request for svgo, if they push back maybe it's finally time for us to implement https://github.com/pre-commit/pre-commit/issues/394

@hectorv I took a stab at a PR, maybe it or something like it will get merged? https://github.com/svg/svgo/pull/786

Looks like the latest version of svgo supports this https://github.com/svg/svgo/commit/e3ddf1d96ab88beb9f496a122dee6ebcb4a0c907

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacobseiler picture jacobseiler  ยท  4Comments

metmajer picture metmajer  ยท  4Comments

alkuzad picture alkuzad  ยท  4Comments

fczuardi picture fczuardi  ยท  3Comments

max-sixty picture max-sixty  ยท  3Comments