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 (#2002)
Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
@ -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()]
|
||||
|
Reference in New Issue
Block a user