Description of changes:
At present if you want to use the git-secrets pre-commit hook you must first follow the git-secrets installation instructions. In contrast many other pre-commit hooks are designed to be self-contained, they automatically install themselves to a directory controlled by pre-commit when pre-commit run is called. This improves the developer experience of projects using this hook, since new developers can just run pre-commit ... without any pre-requisite setup.
This PR changes the pre-commit hook entry to a wrapper script that detects the location of the cloned git-secrets directory, and adds it to PATH so git secrets can be run without any manual setup.
A further benefit is that the version of git-secrets used will match the git revision specified in the .pre-commit-config.yaml instead of whatever version the user has installed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: -
Description of changes: At present if you want to use the git-secrets pre-commit hook you must first follow the git-secrets installation instructions. In contrast many other pre-commit hooks are designed to be self-contained, they automatically install themselves to a directory controlled by pre-commit when
pre-commit run
is called. This improves the developer experience of projects using this hook, since new developers can just runpre-commit ...
without any pre-requisite setup.This PR changes the pre-commit hook
entry
to a wrapper script that detects the location of the cloned git-secrets directory, and adds it toPATH
sogit secrets
can be run without any manual setup.A further benefit is that the version of git-secrets used will match the git revision specified in the
.pre-commit-config.yaml
instead of whatever version the user has installed.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.