mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
formatting
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# copied from esphome
|
||||
# run from Linux using ./scripts/clang-forrmat.py
|
||||
|
||||
from helpers import get_output, src_files, filter_changed
|
||||
import argparse
|
||||
import multiprocessing
|
||||
import os
|
||||
@@ -14,7 +15,7 @@ import threading
|
||||
import click
|
||||
|
||||
sys.path.append(os.path.dirname(__file__))
|
||||
from helpers import get_output, src_files, filter_changed
|
||||
|
||||
|
||||
def run_format(args, queue, lock, failed_files):
|
||||
"""Takes filenames out of queue and runs clang-format on them."""
|
||||
@@ -27,11 +28,13 @@ def run_format(args, queue, lock, failed_files):
|
||||
invocation.extend(['--dry-run', '-Werror'])
|
||||
invocation.append(path)
|
||||
|
||||
proc = subprocess.run(invocation, capture_output=True, encoding='utf-8')
|
||||
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(
|
||||
"\033[0;32m************* File \033[1;32m{}\033[0m".format(path))
|
||||
print(proc.stdout)
|
||||
print(proc.stderr)
|
||||
print()
|
||||
@@ -42,6 +45,7 @@ def run_format(args, queue, lock, failed_files):
|
||||
def progress_bar_show(value):
|
||||
return value if value is not None else ''
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-j', '--jobs', type=int,
|
||||
|
||||
Reference in New Issue
Block a user