1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

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

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

View File

@@ -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()]