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

Add pre-commit hook #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add pre-commit hook #17

wants to merge 1 commit into from

Conversation

m-kuhn
Copy link
Contributor

@m-kuhn m-kuhn commented Mar 4, 2024

Quality of life improvement

Using pre-commit hook to automatically format files

Install and enable pre-commit in your local git clone to automatically
have manifest files formatted whenever you git commit something.

pip install pre-commit
pre-commit install

@Thomas1664
Copy link

This doesn't solve the version db management. The issue with that is that we have to figure out when to use --overwrite-version. We could avoid this issue by comparing the version file with the one from the branch we want to merge into and only add the flag if they're not identical.

@m-kuhn
Copy link
Contributor Author

m-kuhn commented Mar 4, 2024

This doesn't solve the version db management.

Correct, this doesn't solve anything with versioning and just adds a simple formatter. I mentioned it in the other discussion as a starting point for generic vcpkg helper pre-commit hooks.

The issue with that is that we have to figure out when to use --overwrite-version. We could avoid this issue by comparing the version file with the one from the branch we want to merge into and only add the flag if they're not identical.

How would you determine the base branch (merge target) on the developer machine where this hook is run?

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

Successfully merging this pull request may close these issues.

2 participants