purebasic
purebasic copied to clipboard
Custom Git Hooks for EditorConfig
-
Add to the repository scripts to install and remove a custom pre-commit Git hook that will validate all staged files via EClint:
-
git-hook-install.sh
-
git-hook-remove.sh
The advantage of the hook (compared to
vaildate.sh
) is that it will only validate the staged changed files, not the whole project folder. -
-
Add the hook scripts to the export-ignore rules in
.gitattributes
, so they won't be included in the downloadable Zip archive of the project. -
Update
CONTRIBUTING.md
with instructions on how to install and use the new Git hook. -
Set to executable some shell scripts that weren't.
Don't Merge Yet!
The hook scripts are incomplete, I should add the PB specific checks for IDE settings in source files and for trailing spaces (allowing spaces only lines).
I only need to adapt some snippets from validate.sh
and add them to hook-installer script, but tweaked to carry out the checks only on staged files.
When I have some time I'll fix this and do some tests.
Don't Merge Yet!
For that you can also mark the PR as draft PR ;)
For that you can also mark the PR as draft PR ;)
I can't see that option. Where should I find it?
For that you can also mark the PR as draft PR ;)
I can't see that option. Where should I find it?
Thanks for the link @SicroAtGit! I had a vague remembrance of this feature, but forgot how to access it.
Is this pull request still relevent ?
Is this pull request still relevent ?
Probably not. I'll remove the PR, and just keep the local branch.