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

Integrate with pre-commit framework #179

Open
TribuneX opened this issue Dec 20, 2024 · 5 comments
Open

Integrate with pre-commit framework #179

TribuneX opened this issue Dec 20, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@TribuneX
Copy link

Feature Request

Summary

We heavily automate our git related tooling with pre-commit. Wouldn't this be a good fit for git-sumi as well?

Motivation

pre-commit is a widely used framework for commit hooks. It also makes it easy to discover new hooks (given the project meets certain requirements).

Detailed Description

Implementing a pre-commit hook is straight forward.

Additional Context

I could also provide a PR if thats a desired feature.

@TribuneX TribuneX added the enhancement New feature or request label Dec 20, 2024
@welpo
Copy link
Owner

welpo commented Dec 20, 2024

Hi Sascha!

I've seen pre-commit used in many projects, so I think it would make sense to integrate git-sumi with it!

I'd definitely take a PR for this. I can help with documentation or any questions/issues. Let me know!

@TribuneX
Copy link
Author

Great. I'll take a look and will provide an PR for this. I do not have experience with rust / cargo yet. But thats solvable 😃.

@welpo
Copy link
Owner

welpo commented Dec 23, 2024

Great! Do not hesitate to reach out for help!!

@TribuneX
Copy link
Author

TribuneX commented Jan 17, 2025

I started looking into this. It looks like pre-commit does not pass the commit message but a file which may contain the commit message, which makes sense, since the commit message can span multiple lines:

prepare-commit-msg hooks will be passed a single filename -- this file may be empty or it could contain the commit message from -m or from other templates. prepare-commit-msg hooks can modify the contents of this file to change what will be committed.

See docs

Seems that git sumi does not have a cli flag yet to cope with this case. Any ideas how to integrate it with pre-commit this way?

@welpo
Copy link
Owner

welpo commented Jan 17, 2025

Now it does :)

After #198 you can use --file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants