From 3407f16ad5d4797a0fbec2739c9a984e7e5669d1 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Wed, 21 Jun 2023 13:15:46 -0400 Subject: [PATCH] format_code.py: fix NameError when --d is specified It appears that there is a copy/paste error in `list_files_from_directory()` where it uses a local variable named `line`; however, the _correct_ local variable name is `filename`. --- scripts/format_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/format_code.py b/scripts/format_code.py index 31d181aec9..87fbb2f4f9 100755 --- a/scripts/format_code.py +++ b/scripts/format_code.py @@ -165,7 +165,7 @@ def list_files_from_directory(path, recurse): filenames = [] for root, dirs, files in os.walk(path): for filename in files: - if(FILE_PATHS_TO_IGNORE.match(line)): + if(FILE_PATHS_TO_IGNORE.match(filename)): continue if filename.endswith(FILE_TYPE_EXTENSIONS): full_path = os.path.join(root, filename)