From b41c89a8a7e19096a1b5cd3e83ff41258ebaf60d Mon Sep 17 00:00:00 2001
From: Brecht Van Lommel <brecht@blender.org>
Date: Tue, 10 May 2022 19:18:50 +0200
Subject: [PATCH] Fix make format PATHS=/path/to/directory not working
 correctly

Error in recent change to filter out files with the wrong extension.
---
 utils_maintenance/autopep8_format_paths.py | 2 +-
 utils_maintenance/clang_format_paths.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils_maintenance/autopep8_format_paths.py b/utils_maintenance/autopep8_format_paths.py
index 100a308..36ed84b 100644
--- a/utils_maintenance/autopep8_format_paths.py
+++ b/utils_maintenance/autopep8_format_paths.py
@@ -35,7 +35,7 @@ def compute_paths(paths, use_default_paths):
     else:
         paths = [
             f for f in paths
-            if os.path.isfile(f) and f.endswith(extensions)
+            if not os.path.isfile(f) or f.endswith(extensions)
         ]
 
     if os.sep != "/":
diff --git a/utils_maintenance/clang_format_paths.py b/utils_maintenance/clang_format_paths.py
index e81d487..cd702e8 100755
--- a/utils_maintenance/clang_format_paths.py
+++ b/utils_maintenance/clang_format_paths.py
@@ -64,7 +64,7 @@ def compute_paths(paths, use_default_paths):
         # "Operating" on files that will be filtered out later on.
         paths = [
             f for f in paths
-            if os.path.isfile(f) and f.endswith(extensions)
+            if not os.path.isfile(f) or f.endswith(extensions)
         ]
 
     if os.sep != "/":
-- 
GitLab