1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-19 06:45:49 +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,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 = []