From 0b468953bee7644ebef845161efde9ebeb4a1ade Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:02:07 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pre_commit/commands/install_uninstall.py | 6 +++--- tests/commands/install_uninstall_test.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py index bb8bc030..c5795236 100644 --- a/pre_commit/commands/install_uninstall.py +++ b/pre_commit/commands/install_uninstall.py @@ -76,13 +76,13 @@ def _install_hook_script( # If the hooks directory links to a directory outside the # git repo we shouldn't try to mess with it if os.path.commonpath( - [os.path.realpath(git_dir), os.path.realpath(hook_path)] - ) != os.path.realpath(git_dir): + [os.path.realpath(git_dir), os.path.realpath(hook_path)], + ) != os.path.realpath(git_dir): logger.error( 'Cowardly refusing to install hook script to a directory ' 'outside of the git repo.\n' f'hint: {os.path.dirname(hook_path)} is a symbolic link ' - f'to {os.path.realpath(os.path.dirname(hook_path))}.' + f'to {os.path.realpath(os.path.dirname(hook_path))}.', ) return 1 diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py index 98a305d8..ac3faa05 100644 --- a/tests/commands/install_uninstall_test.py +++ b/tests/commands/install_uninstall_test.py @@ -111,7 +111,7 @@ def test_install_hooks_dead_symlink(in_git_dir, store): def test_install_hooks_symlink_outisde_git_repo(in_git_dir, store): hook_dir = in_git_dir.join('.git/hooks') - hook_dir.mksymlinkto(in_git_dir.join("../hooks")) + hook_dir.mksymlinkto(in_git_dir.join('../hooks')) hook = hook_dir.join('pre-commit') assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) != 0 assert not hook.exists()