]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
refactor: replace 'git ls-files' + 'grep' by a single 'git grep'
authorDenis Laxalde <denis.laxalde@dalibo.com>
Fri, 13 Oct 2023 06:54:01 +0000 (08:54 +0200)
committerDenis Laxalde <denis.laxalde@dalibo.com>
Fri, 13 Oct 2023 07:56:22 +0000 (09:56 +0200)
tools/async_to_sync.py

index c3ccb27469ae952a83327eab5d8d9dd5813602bb..0bb9871dba6d65e3026a5b453ae8df7ad13d1b92 100755 (executable)
@@ -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?")