mirror of
https://github.com/esphome/esphome.git
synced 2025-06-19 06:45:49 +01:00
Consistently format errors in CI scripts (#2762)
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from helpers import git_ls_files, filter_changed
|
||||
from helpers import styled, print_error_for_file, git_ls_files, filter_changed
|
||||
import argparse
|
||||
import codecs
|
||||
import collections
|
||||
import colorama
|
||||
import fnmatch
|
||||
import functools
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import functools
|
||||
import argparse
|
||||
|
||||
sys.path.append(os.path.dirname(__file__))
|
||||
|
||||
@ -30,6 +30,8 @@ def find_all(a_str, sub):
|
||||
column += len(sub)
|
||||
|
||||
|
||||
colorama.init()
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"files", nargs="*", default=[], help="files to be processed (regex on path)"
|
||||
@ -657,10 +659,8 @@ for fname in files:
|
||||
run_checks(LINT_POST_CHECKS, "POST")
|
||||
|
||||
for f, errs in sorted(errors.items()):
|
||||
print(f"\033[0;32m************* File \033[1;32m{f}\033[0m")
|
||||
for lineno, col, msg in errs:
|
||||
print(f"ERROR {f}:{lineno}:{col} - {msg}")
|
||||
print()
|
||||
err_str = (f"{styled(colorama.Style.BRIGHT, f'{f}:{lineno}:{col}:')} {msg}\n" for lineno, col, msg in errs)
|
||||
print_error_for_file(f, "\n".join(err_str))
|
||||
|
||||
if args.print_slowest:
|
||||
lint_times = []
|
||||
|
Reference in New Issue
Block a user