purebasic icon indicating copy to clipboard operation
purebasic copied to clipboard

Custom Git Hooks for EditorConfig

Open tajmone opened this issue 3 years ago • 5 comments

  • 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.

tajmone avatar May 17 '21 04:05 tajmone

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.

tajmone avatar May 17 '21 19:05 tajmone

Don't Merge Yet!

For that you can also mark the PR as draft PR ;)

Naheulf avatar May 17 '21 21:05 Naheulf

For that you can also mark the PR as draft PR ;)

I can't see that option. Where should I find it?

tajmone avatar May 17 '21 23:05 tajmone

For that you can also mark the PR as draft PR ;)

I can't see that option. Where should I find it?

Converting a pull request to a draft

SicroAtGit avatar May 17 '21 23:05 SicroAtGit

Thanks for the link @SicroAtGit! I had a vague remembrance of this feature, but forgot how to access it.

tajmone avatar May 17 '21 23:05 tajmone

Is this pull request still relevent ?

fantaisie-software avatar Apr 28 '23 09:04 fantaisie-software

Is this pull request still relevent ?

Probably not. I'll remove the PR, and just keep the local branch.

tajmone avatar Apr 28 '23 11:04 tajmone