]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore(async-to-sync): drop --all argument
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Apr 2024 17:37:25 +0000 (19:37 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 12 Apr 2024 22:05:34 +0000 (00:05 +0200)
Working on all inputs is a meaningful default.

.github/workflows/lint.yml
tools/async_to_sync.py

index d9a533ccbe58ae7e052a6e96036d1bf03f21b969..64c42ede02e0dc0d0e78f99df12b448b4329c448 100644 (file)
@@ -37,7 +37,7 @@ jobs:
         run: mypy
 
       - name: Check for sync/async inconsistencies
-        run: ./tools/async_to_sync.py --all --check -B
+        run: ./tools/async_to_sync.py --check -B
 
       - name: Check spelling
         run: codespell
index 16b67e4da077a5869e20cca6911d53b63fdc83e9..c748bbe9ca29b7a01fed5048a1dd3eff5af479d9 100755 (executable)
@@ -138,7 +138,7 @@ def check(outputs: list[str]) -> int:
         logger.error("sync and async files... out of sync!")
         return 1
 
-    # Check that all the files to convert are included in the --all list
+    # Check that all the files to convert are included in the ALL_INPUTS files list
     cmdline = ["git", "grep", "-l", f"auto-generated by '{SCRIPT_NAME}'", "**.py"]
     maybe_conv = sp.check_output(cmdline, cwd=str(PROJECT_DIR), text=True).split()
     if not maybe_conv:
@@ -149,7 +149,7 @@ def check(outputs: list[str]) -> int:
     )
     if unk_conv:
         logger.error(
-            "files converted by %s but not included in --all list: %s",
+            "files converted by %s but not included in ALL_INPUTS: %s",
             SCRIPT_NAME,
             ", ".join(unk_conv),
         )
@@ -559,9 +559,6 @@ def parse_cmdline() -> Namespace:
     parser.add_argument(
         "--check", action="store_true", help="return with error in case of differences"
     )
-    parser.add_argument(
-        "--all", action="store_true", help="process all the files of the project"
-    )
     parser.add_argument(
         "-B",
         "--convert-all",
@@ -605,18 +602,12 @@ def parse_cmdline() -> Namespace:
         metavar="FILE",
         nargs="*",
         type=Path,
-        help="the files to process (if --all is not specified)",
+        help="the files to process (process all files if not specified)",
     )
 
     opt = parser.parse_args()
-    if opt.all and opt.inputs:
-        parser.error("can't specify input files and --all together")
-
-    if opt.all:
-        opt.inputs = [PROJECT_DIR / Path(fn) for fn in ALL_INPUTS]
-
     if not opt.inputs:
-        parser.error("no input file provided")
+        opt.inputs = [PROJECT_DIR / Path(fn) for fn in ALL_INPUTS]
 
     fp: Path
     for fp in opt.inputs: