From 9a3bddef4088efa9918292a5c29cb9a3f42d213d Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 25 Mar 2025 18:32:20 +0800 Subject: [PATCH] Update [ghstack-poisoned] --- codemcp/glob.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/codemcp/glob.py b/codemcp/glob.py index fa3fd5d8..655741be 100644 --- a/codemcp/glob.py +++ b/codemcp/glob.py @@ -30,7 +30,7 @@ def translate_pattern( editorconfig_asterisk = editorconfig editorconfig_double_asterisk = editorconfig i, n = 0, len(pattern) - result = [] + result: List[str] = [] # Handle escaped characters escaped = False @@ -178,7 +178,7 @@ def translate_pattern( else: # Handle comma-separated items {s1,s2,s3} # Split but respect any nested braces - items = [] + items: List[str] = [] start = 0 nested_depth = 0 @@ -200,7 +200,7 @@ def translate_pattern( i = i - len(brace_content) - 2 else: # Process each item recursively to handle nested braces - processed_items = [] + processed_items: List[str] = [] for item in items: # For nested patterns, recursively translate but without the anchors if "{" in item: @@ -324,7 +324,7 @@ def find( Returns: List of paths that match any of the patterns """ - result = [] + result: List[str] = [] matchers = [ make_matcher( pattern, @@ -341,7 +341,7 @@ def find( return result # Walk filesystem - for dirpath, dirnames, filenames in os.walk(root): + for dirpath, _, filenames in os.walk(root): rel_dirpath = os.path.relpath(dirpath, root) if rel_dirpath == ".": rel_dirpath = ""