#!/usr/bin/python3 # SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only import os import subprocess import argparse import util from format_util import find_files from format_util import execute_threaded from sys import stdout stdout.reconfigure(encoding='utf-8') def format_file_function(file): executable = "clang-format" if os.name == 'nt': executable = "clang-format.exe" process = subprocess.run(" %s -style=file -i %s" % (executable, file), capture_output=True, shell=True) print("Format: %s \t return: %s" % (file, process.returncode)) def check_format_file_function(file): executable = "clang-format" if os.name == 'nt': executable += ".exe" result = subprocess.run(" %s -style=file --output-replacements-xml %s" % (executable, file), capture_output=True, shell=True, text=True) # Check for opening replacement tag with attributes (a space after it indicates attributes) if "