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
Changes to pre commit hook. Fixes #794 #795
Changes to pre commit hook. Fixes #794 #795
Conversation
Add new hook to prevent commits to protected branches. Fix serializer hook to correctly find serializer jar file.
@Jamie-SA We have branch protection rules on develop and main. Why do we need to replicate them in the pre-commit hook? |
Because it prevents someone from doing what you did yesterday. It stops you from making the commit to the branch in the first place, as opposed to stopping you from pushing the branch to github. I personally much prefer to be told up front that I forgot to create a feature branch, instead of having to fix the problem afterwards. |
OK, makes sense. I love the fact that my stupidity was the driver of an improvement. :) |
Well, I've done it several times myself which is why I already had done this for the dca repo and figured it would be easy to add to gist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good here, and I've tested it out.
@Jamie-SA Hm, it just occurred to me - do |
Good point. I suppose we could just update the docs for now and tell people on Windows to copy the pre-commit file, or we could write the equivalent |
I looked into it, there might be a way to write a script that will work on both. I will see if I can get it to work. |
We could also tell windows users they can run the sh file in a bash shell - which people will have if they use VSCode, for example. But if you can write a single script that would be fine. Two is not ideal, obviously, for maintenance reasons. You need to open a new PR since I already merged this one. |
Fixes #794
Everyone should run the script
./tools/setup.sh
after pulling in these changes.