From c00ee62b26cf0472bee3d3ffbfb1642d83ba067b Mon Sep 17 00:00:00 2001 From: akfreed Date: Tue, 17 May 2022 22:37:46 -0700 Subject: [PATCH] Seeing if my change broke tests. --- hooks/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/utils.py b/hooks/utils.py index 8d5e465..30cc297 100755 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -17,7 +17,7 @@ def __init__(self, command: str, look_behind: str, args: List[str]): self.look_behind = look_behind self.command = command # Will be [] if not run using pre-commit or if there are no committed files - self.files = self.get_added_files(args) + self.files = self.get_added_files() self.edit_in_place = False self.stdout = b"" @@ -35,9 +35,9 @@ def check_installed(self): ) # noqa: E501 self.raise_error(problem, details) - def get_added_files(self, args): + def get_added_files(self): """Find added files using git.""" - added_files = args[1:] # 1: don't include the hook file + added_files = sys.argv[1:] # 1: don't include the hook file # cfg files are used by uncrustify and won't be source files added_files = [f for f in added_files if os.path.exists(f) and not f.endswith(".cfg")]