scripts: ci: Fix clang-format compliance on Windows
Clang-format installs an exe instead of a python script. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
6d19bcf333
commit
8fcccf1aad
1 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@ import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -273,6 +274,8 @@ class ClangFormatCheck(ComplianceTest):
|
||||||
path_hint = "<git-top>"
|
path_hint = "<git-top>"
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
exe = f"clang-format-diff.{'exe' if platform.system() == 'Windows' else 'py'}"
|
||||||
|
|
||||||
for file in get_files():
|
for file in get_files():
|
||||||
if Path(file).suffix not in ['.c', '.h']:
|
if Path(file).suffix not in ['.c', '.h']:
|
||||||
continue
|
continue
|
||||||
|
@ -281,7 +284,7 @@ class ClangFormatCheck(ComplianceTest):
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
cwd=GIT_TOP)
|
cwd=GIT_TOP)
|
||||||
try:
|
try:
|
||||||
subprocess.run(('clang-format-diff.py', '-p1'),
|
subprocess.run((exe, '-p1'),
|
||||||
check=True,
|
check=True,
|
||||||
stdin=diff.stdout,
|
stdin=diff.stdout,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue