diff --git a/tests/restyle.py b/tests/restyle.py index 0517ddac8a..b2e625ef2d 100755 --- a/tests/restyle.py +++ b/tests/restyle.py @@ -19,8 +19,7 @@ def clang_format(clang_format, config, files): cmd = [clang_format, "--verbose", f"--style=file:{config.as_posix()}", "-i"] cmd.extend(files) - proc = subprocess.run(cmd) - proc.check_returncode() + subprocess.run(cmd, check=True) def find_files(patterns): @@ -88,10 +87,12 @@ def find_arduino_files(): # ref. https://github.com/libgit2/pygit2/blob/master/src/diff.c ::parse_diff # TODO: pygit2? def changed_files(): - cmd = ["git", "--no-pager", "diff"] - - proc = subprocess.run(cmd, capture_output=True, universal_newlines=True) - proc.check_returncode() + proc = subprocess.run( + ["git", "--no-pager", "diff"], + capture_output=True, + check=True, + universal_newlines=True, + ) out = [] @@ -174,7 +175,6 @@ def assert_unchanged(): def run_format(args): - print(args) targets = [] for include in args.include: diff --git a/tests/restyle.sh b/tests/restyle.sh index c35aa34b50..ab2123fa8d 100755 --- a/tests/restyle.sh +++ b/tests/restyle.sh @@ -13,4 +13,4 @@ CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15} cd $root python $root/tests/restyle.py format --clang-format=$CLANG_FORMAT preset --include core --include arduino -python $root/tests/restyle.py assert +python $root/tests/restyle.py assert --with-summary --with-notice