From d5d07ea7b8c03c01b11a40ca440aeeab12f3cbf4 Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 10 Jan 2024 21:27:21 -0800 Subject: [PATCH] Skip cmake formatter on high core count systems --- wpiformat/wpiformat/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wpiformat/wpiformat/__init__.py b/wpiformat/wpiformat/__init__.py index 9ea1df6..60f4bce 100644 --- a/wpiformat/wpiformat/__init__.py +++ b/wpiformat/wpiformat/__init__.py @@ -512,7 +512,12 @@ def main(): run_pipeline(task_pipeline, args, files) # Lint is run last since previous tasks can affect its output. - task_pipeline = [CMakeFormat(), PyFormat(), Lint()] + # CMakeFormat doesn't work on high core count machines + if mp.cpu_count() > 60: + task_pipeline = [PyFormat(), Lint()] + print("Skipping CMake Formatter due to too high of CPU count") + else: + task_pipeline = [CMakeFormat(), PyFormat(), Lint()] # Check tasks are all batch tasks invalid_tasks = [