mirror of
https://github.com/esphome/esphome.git
synced 2025-07-05 22:53:10 +01:00
Consistently format errors in CI scripts (#2762)
This commit is contained in:
@ -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(),
|
||||
|
Reference in New Issue
Block a user