NationalCentreTruthReconciliation / Secure-Record-Transfer

A transfer portal incorporating CAAIS and BagIt Specifications
https://secure-record-transfer.readthedocs.io/en/latest/
4 stars 2 forks source link

Add pre-commit hook to add and update linting configuration #202

Closed yenaing-oo closed 1 month ago

yenaing-oo commented 1 month ago

Notes

yenaing-oo commented 1 month ago

This is definitely much cleaner!

I tested it out, and there is a change and additional steps required to make it work:

I think we can do away with the installation script and simply include the pre-commit hook with executable permissions and track that. Because git uses the hooks in .git/hooks by default, I found a way to configure git to use our custom git hooks instead, by calling:

git config core.hooksPath <custom_githooks_dir_name>

I've made these changes in my PR.

yenaing-oo commented 1 month ago

I believe the default behaviour of git config is local.

https://git-scm.com/docs/git-config#_description

When writing, the new value is written to the repository local configuration file by default, and options --system, --global, --worktree, --file can be used to tell the command to write to that location (you can say --local but that is the default).