sea-orm
sea-orm copied to clipboard
Addition of pre-commit script
Signed-off-by: Abhijith Ganesh [email protected]
PR Info
- Closes #610
- Dependencies:
- None
- Dependents:
- None
Adds
A pre-commit script that takes care of CI and commit signing.
Fixes
None
Breaking Changes
None
Changes
Adds DCO Workflow to the project
Is there a difference between DCO and -s
? I thought they were the same thing. We agreed not to enforce GPG based commit signing
According to the docs , I think -s and DCO are the same thing?
im guessing what billy means is that instead of adding a check and making the user add a -s
flag to the commit, use a pre commit hook to add the flag automatically
pre commit hook is something like husky
Thanks!! @kakarot-dev That's what I meant :P
I can integrate the same
Yeah but what if the contributors don't use Husky ? It won't sign it off?
Well first off, Husky is a nodejs module, so i cant see how ur gonna use it in seaorm
Secondly, pre commit hooks can also be configured by git config core.hooksPath <dir>
My suggestion is to make a .sh ( strictly names as pre-commit
) doing the precommit, then add that using the above command during the initialization of the project
For refrence, you can check this out
well the whole thing isnt completed yet, if pre commit is by default meant to be implemented
So, the pre-commit hook should be run on commit and without the need to config / enable it?
So, the pre-commit hook should be run on commit and without the need to config / enable it?
It wont run rn if you dont config it with git config core.hooksPath
But then again, that command works for a dir, @AbhijithGanesh can u tell how r u planning to make this work?
@billy1624 any suggestions?
I think it's better to add the extra -s
when performing git commit and leave testing for GitHub Actions to handle it
Btw... @tyt2y3 do you think we should enforce Developer Certificate of Origin (DCO)? https://github.com/apps/dco
The script does add -s
, in addition, the script runs couple of tests, thats it. If you want the tests removed, let me know!
Tests r not optional tho… Also how bout moving the scripts to a folder and adding some lines that specify how to set it up with git
The tests are not optional because they are being run in the script. Do you want them optional?
Also how bout moving the scripts to a folder and adding some lines that specify how to set it up with git
I'd say we only have a few scripts, so the folder part is not necessary, but how to set it up with git can be done!
@billy1624 can you look at this please? Thanks
Hey @AbhijithGanesh, as I said on the Discord. I would suggest not to enforce DCO with GitHub Action. Maybe we can just add a pre-commit hook to add the sign
-s
flag when runninggit commit
.
I would suggest that you check everything you want enforced in a pipeline, after all git commit --no-verify
skips the hooks, or contributors might forget to install the hooks on a new machine.
Also git config --global commit.gpgsign true
(not sure) might be an option, which goes in a similar direction like a hook. (Downside you need an ssh key, upside it is actually signed). Unfortunately I ahve not found a plain signoff option that could be set.
That said, the reason I am writing here is #591 and the resulting #757 which was created before I was aware of this PR.