1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-20 07:15:47 +01:00

Fix clang-format script behaviour without -i + code cleanup ()

Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Oxan van Leeuwen
2021-07-25 23:54:32 +02:00
committed by GitHub
parent 66cdb761dc
commit 3749c11f21
4 changed files with 57 additions and 77 deletions

@ -145,8 +145,10 @@ def filter_changed(files):
return files
def git_ls_files():
def git_ls_files(patterns=None):
command = ["git", "ls-files", "-s"]
if patterns is not None:
command.extend(patterns)
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
output, err = proc.communicate()
lines = [x.split() for x in output.decode("utf-8").splitlines()]