From: Denis Laxalde Date: Fri, 13 Oct 2023 06:54:01 +0000 (+0200) Subject: refactor: replace 'git ls-files' + 'grep' by a single 'git grep' X-Git-Tag: pool-3.2.0~12^2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0dd10e3d6dcccac4053c55b8ee3e830912b3154;p=thirdparty%2Fpsycopg.git refactor: replace 'git ls-files' + 'grep' by a single 'git grep' --- diff --git a/tools/async_to_sync.py b/tools/async_to_sync.py index c3ccb2746..0bb9871db 100755 --- a/tools/async_to_sync.py +++ b/tools/async_to_sync.py @@ -103,11 +103,7 @@ def check(outputs: list[str]) -> int: return 1 # Check that all the files to convert are included in the --all list - cmdline = ["git", "ls-files", "**.py"] - git_pys = sp.check_output(cmdline, cwd=str(PROJECT_DIR)).decode().split() - - cmdline = ["grep", "-l", f"auto-generated by '{SCRIPT_NAME}'"] - cmdline += git_pys + cmdline = ["git", "grep", "-l", f"auto-generated by '{SCRIPT_NAME}'", "**.py"] maybe_conv = sp.check_output(cmdline, cwd=str(PROJECT_DIR)).decode().split() if not maybe_conv: logger.error("no file to check? Maybe this script bitrot?")