Skip to content

Commit

Permalink
scripts: ci: Fix clang-format compliance on Windows
Browse files Browse the repository at this point in the history
Clang-format installs an exe instead of a python script.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt authored and fabiobaltieri committed Aug 21, 2024
1 parent 6d19bcf commit 8fcccf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import logging
import os
from pathlib import Path
import platform
import re
import subprocess
import sys
Expand Down Expand Up @@ -273,6 +274,8 @@ class ClangFormatCheck(ComplianceTest):
path_hint = "<git-top>"

def run(self):
exe = f"clang-format-diff.{'exe' if platform.system() == 'Windows' else 'py'}"

for file in get_files():
if Path(file).suffix not in ['.c', '.h']:
continue
Expand All @@ -281,7 +284,7 @@ def run(self):
stdout=subprocess.PIPE,
cwd=GIT_TOP)
try:
subprocess.run(('clang-format-diff.py', '-p1'),
subprocess.run((exe, '-p1'),
check=True,
stdin=diff.stdout,
stdout=subprocess.PIPE,
Expand Down

0 comments on commit 8fcccf1

Please sign in to comment.