1
0
mirror of https://github.com/esphome/esphome.git synced 2025-07-05 22:53:10 +01:00

Consistently format errors in CI scripts ()

This commit is contained in:
Oxan van Leeuwen
2021-11-25 21:54:11 +01:00
committed by GitHub
parent 9681dfb458
commit 00965fe19e
8 changed files with 57 additions and 55 deletions

@ -1,6 +1,9 @@
#!/usr/bin/env python3
from helpers import print_error_for_file, get_output, git_ls_files, filter_changed
import argparse
import click
import colorama
import multiprocessing
import os
import queue
@ -9,11 +12,6 @@ import subprocess
import sys
import threading
import click
sys.path.append(os.path.dirname(__file__))
from helpers import get_output, git_ls_files, filter_changed
def run_format(args, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-format on them."""
@ -29,11 +27,7 @@ def run_format(args, queue, lock, failed_files):
proc = subprocess.run(invocation, capture_output=True, encoding='utf-8')
if proc.returncode != 0:
with lock:
print()
print("\033[0;32m************* File \033[1;32m{}\033[0m".format(path))
print(proc.stdout)
print(proc.stderr)
print()
print_error_for_file(path, proc.stderr)
failed_files.append(path)
queue.task_done()
@ -43,6 +37,8 @@ def progress_bar_show(value):
def main():
colorama.init()
parser = argparse.ArgumentParser()
parser.add_argument('-j', '--jobs', type=int,
default=multiprocessing.cpu_count(),