mirror of
https://github.com/AdaCore/git-hooks.git
synced 2026-02-12 12:43:11 -08:00
This commit introduces a new class (ThirdPartyHook), which centralizes the handling of third-party hooks (scripts that project set up via the configuration file). Most of the code is simply a move of the code from maybe_call_thirdparty_hook, with a couple of enhancements: - Ability to specify the directory from which to call the hook; - Handling of the situation when calling the hook itself fails. We can already see the benefits of this in function style_check_files, where the code now necessary to call the style_checker is both clearer and more compact. In the future, the intent is to push this class one step further to allow users to specify hooks to be fetched from the repository, rather than requiring that the hooks be installed (usually by an admin) on the machine hosting the repository. The current class' API should allow us to implement this in a way that's transparent to all users. Change-Id: Ie8bf8accbbfd75a91b914628fad27d780532dac4 TN: T209-005
4.4 KiB
4.4 KiB