Skip to content

Commit 8fcccf1

Browse files
pdgendtfabiobaltieri
authored andcommitted
scripts: ci: Fix clang-format compliance on Windows
Clang-format installs an exe instead of a python script. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 6d19bcf commit 8fcccf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/ci/check_compliance.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import logging
1212
import os
1313
from pathlib import Path
14+
import platform
1415
import re
1516
import subprocess
1617
import sys
@@ -273,6 +274,8 @@ class ClangFormatCheck(ComplianceTest):
273274
path_hint = "<git-top>"
274275

275276
def run(self):
277+
exe = f"clang-format-diff.{'exe' if platform.system() == 'Windows' else 'py'}"
278+
276279
for file in get_files():
277280
if Path(file).suffix not in ['.c', '.h']:
278281
continue
@@ -281,7 +284,7 @@ def run(self):
281284
stdout=subprocess.PIPE,
282285
cwd=GIT_TOP)
283286
try:
284-
subprocess.run(('clang-format-diff.py', '-p1'),
287+
subprocess.run((exe, '-p1'),
285288
check=True,
286289
stdin=diff.stdout,
287290
stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)