From 797fe4db734283c9c6dd2c40916b36eb4c89843d Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 5 Dec 2023 23:16:12 -0500 Subject: [PATCH] extended split_list_arg to split by whitespaces while ignoring filepaths with whitespaces (escaped with '\' extended list_files to normalize filepaths containing whitespaces (escaped with '\') --- run-clang-format.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run-clang-format.py b/run-clang-format.py index c82a1dd..8628985 100755 --- a/run-clang-format.py +++ b/run-clang-format.py @@ -22,6 +22,7 @@ import subprocess import sys import traceback +import re from distutils.util import strtobool from functools import partial @@ -69,6 +70,7 @@ def list_files(files, recursive=False, extensions=None, exclude=None): out = [] for file in files: + file = file.replace("\\", "") if recursive and os.path.isdir(file): for dirpath, dnames, fnames in os.walk(file): fpaths = [os.path.join(dirpath, fname) for fname in fnames] @@ -248,6 +250,14 @@ def split_list_arg(arg): Otherwise it is returned unchanged Workaround for GHA not allowing list arguments """ + pattern = r'(?