From 4b77d27febc976dfb3894564055ab2f03d468c9e Mon Sep 17 00:00:00 2001 From: Rob Rodriguez Date: Thu, 2 Nov 2023 11:00:03 -0700 Subject: [PATCH] chore: Issue 159 - Using latest git hooks (#322) https://github.com/slalombuild/secureli/issues/159 [Pre-commit does not support using a latest tag](https://pre-commit.com/#using-the-latest-version-for-a-repository), the only way to use latest is to update after install. I tested these changes by updating the version I installed with brew re-initializing a test repo with javascript and python code. It looks like the fix I made to the update command could use a regression test, that line of code cannot run without a folder path argument. Co-authored-by: Rob Rodriguez --- secureli/main.py | 1 + secureli/services/updater.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/secureli/main.py b/secureli/main.py index b0d0344c..603bb171 100644 --- a/secureli/main.py +++ b/secureli/main.py @@ -64,6 +64,7 @@ def init( """ SecureliConfig.FOLDER_PATH = Path(directory) container.initializer_action().initialize_repo(Path(directory), reset, yes) + update() @app.command() diff --git a/secureli/services/updater.py b/secureli/services/updater.py index e5be92fd..33649f38 100644 --- a/secureli/services/updater.py +++ b/secureli/services/updater.py @@ -54,7 +54,7 @@ def update_hooks( output = "No changes necessary.\n" if update_result.successful and update_result.output: - prune_result = self.pre_commit.remove_unused_hooks() + prune_result = self.pre_commit.remove_unused_hooks(folder_path) output = output + "\nRemoving unused environments:\n" + prune_result.output return UpdateResult(successful=update_result.successful, output=output)