chore: fix npm run lint not working on Windows (#42281)

* fix: fixed the `npm run lint` not working on Windows.

* chore: more fixes for lint on Windows

* chore: revert change to patch linting

---------

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
This commit is contained in:
reito 2024-07-16 00:08:33 +08:00 committed by GitHub
parent ae1a684d10
commit f173a0637a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 10 deletions

View file

@ -134,6 +134,7 @@ def run_clang_format_diff(args, file_name):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
encoding='utf-8',
shell=True) as proc:
outs = list(proc.stdout.readlines())
errs = list(proc.stderr.readlines())
@ -186,10 +187,7 @@ def colorize(diff_lines):
def print_diff(diff_lines, use_color):
if use_color:
diff_lines = colorize(diff_lines)
if sys.version_info[0] < 3:
sys.stdout.writelines((l.encode('utf-8') for l in diff_lines))
else:
sys.stdout.writelines(diff_lines)
sys.stdout.writelines(diff_lines)
def print_trouble(prog, message, use_colors):