From b3604cf859c2648c0c87b570d80b3885e83d8738 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 4 Oct 2024 10:47:45 -0700 Subject: [PATCH] Fix cpplint args for empty header extension list (#287) --- wpiformat/wpiformat/lint.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wpiformat/wpiformat/lint.py b/wpiformat/wpiformat/lint.py index 0174bd3..4b60cab 100644 --- a/wpiformat/wpiformat/lint.py +++ b/wpiformat/wpiformat/lint.py @@ -53,12 +53,11 @@ def run_batch(config_file, names): basename = os.path.basename(pattern) header_exts.append(basename[basename.rfind(".") + 1 :].rstrip("$")) - sys.argv = [ - "cpplint.py", - "--filter=-" + ",-".join(exclusion_filters), - "--headers=" + ",".join(header_exts) if header_exts else "", - "--quiet", - ] + names + args = ["cpplint.py", "--filter=-" + ",-".join(exclusion_filters)] + if header_exts: + args.append("--headers=" + ",".join(header_exts)) + args.append("--quiet") + sys.argv = args + names # Run cpplint.py try: