boxes icon indicating copy to clipboard operation
boxes copied to clipboard

Add precommit

Open Rotzbua opened this issue 1 year ago • 3 comments

Possible configuration for pre-commit as suggested in #600 .

Second commit just formats the code and may should be dropped before merge and done by maintainer.

Rotzbua avatar Nov 03 '23 14:11 Rotzbua

I am not quite sure what "pre commit" means here. This looks like a GitHub hook which sounds like pre push to me. Otoh why would one need a local installation for that?

florianfesti avatar Nov 15 '23 20:11 florianfesti

Git itself supports various hooks https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

The idea is to test and format code before the commit is created. This reduces the probability that a commit would not pass CI or break the program.

I created a simpler PR which does not format the complete code. So it is simpler to merge, review and may extend it later to this complex configuration.

Rotzbua avatar Nov 22 '23 22:11 Rotzbua

Ok, I rebased this and re-run the pre-commit on the code. I now have one failure (see checks). Looks like my local version sorts the imports differently than in the CI. Any idea on how to get rid of that issue?

florianfesti avatar Mar 12 '24 21:03 florianfesti

@florianfesti did you run it at least twice because of the amount of changes?

Rotzbua avatar Mar 19 '24 21:03 Rotzbua

No, my local version seems to order that one import differently. I'll merge anyway.May be I disable the import ordering later on if that creates too much of an issue.

florianfesti avatar Mar 22 '24 21:03 florianfesti

Thanks for the feedback. I will try to find the reason for this behavour.

Rotzbua avatar Mar 25 '24 15:03 Rotzbua