formatting

This commit is contained in:
proddy
2024-09-25 17:32:31 +02:00
parent e802812fc6
commit 5cba925717
13 changed files with 169 additions and 89 deletions

View File

@@ -3,6 +3,8 @@
# copied from esphome
# run from Linux using ./scripts/clang-forrmat.py
from helpers import shlex_quote, get_output, \
build_all_include, temp_header_file, filter_changed, load_idedata, src_files
import argparse
import multiprocessing
import os
@@ -16,8 +18,7 @@ import click
import pexpect
sys.path.append(os.path.dirname(__file__))
from helpers import shlex_quote, get_output, \
build_all_include, temp_header_file, filter_changed, load_idedata, src_files
def clang_options(idedata):
cmd = [
@@ -46,6 +47,7 @@ def clang_options(idedata):
return cmd
def run_tidy(args, options, tmpdir, queue, lock, failed_files):
while True:
path = queue.get()
@@ -73,20 +75,24 @@ def run_tidy(args, options, tmpdir, queue, lock, failed_files):
if rc != 0:
with lock:
print()
print("\033[0;32m************* File \033[1;32m{}\033[0m".format(path))
print(
"\033[0;32m************* File \033[1;32m{}\033[0m".format(path))
print(output)
print()
failed_files.append(path)
queue.task_done()
def progress_bar_show(value):
if value is None:
return ''
def split_list(a, n):
k, m = divmod(len(a), n)
return [a[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in range(n)]
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-j', '--jobs', type=int,
@@ -187,4 +193,4 @@ def main():
if __name__ == '__main__':
main()
main()