urlstechie / urlchecker-python

:snake: :link: Python module and client for checking URLs
https://urlchecker-python.readthedocs.io
MIT License
20 stars 12 forks source link

add a pre-commit hook #54

Closed aerickson closed 2 years ago

aerickson commented 3 years ago

urlchecker is sweet. It would be great if it was easier to run. Lots of projects use pre-commit (https://pre-commit.com/).

I think all that's required is to create a file like Black provides:

https://github.com/psf/black/blob/master/.pre-commit-hooks.yaml

vsoch commented 3 years ago

That’s a cool idea! What are the advantages to having some custom yaml (like black) vs. just adding the urlchecker command to a pre commit hook file?

aerickson commented 3 years ago

Sorry, editing my response... I kind of missed what you were asking.

Managing git hooks with pre-commit vs manually offers a few advantages:

longer intro to pre-commit: https://pre-commit.com/index.html#intro

vsoch commented 2 years ago

hey @aerickson ! So I finally took a closer look, and decided to give it a shot to generate a pre-commit hook! Design wise, I think this likely is better to live in a different repository, the reason being that we need to change the client (as you found) and we can easily do that in a custom module. @aerickson and @SuperKogito would you care to try it out?

https://github.com/urlstechie/pre-commit

I'm relatively new to using pre-commit so please try the dummy example I added, along with adding custom arguments (it would be good to have an example for that). I'm also thinking we would want a plain pre-commit run to work, however when I do that I don't see any input files, so let's chat about how to get that working! When all is good I can PR here with a link to the repository.

Happy Sunday, and thanks!

SuperKogito commented 2 years ago

Great work @vsoch. This looks nice, I am curious to see how it goes further. Unfortunately I will be able to check this at the earliest on Sunday.

vsoch commented 2 years ago

Closing, please re-open an issue on the pre-commit repo if there are any!