From: Daniele Varrazzo Date: Fri, 12 Apr 2024 17:37:25 +0000 (+0200) Subject: chore(async-to-sync): drop --all argument X-Git-Tag: 3.2.0~46^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ebb83abe465927d45d6698926518691f8a3437f;p=thirdparty%2Fpsycopg.git chore(async-to-sync): drop --all argument Working on all inputs is a meaningful default. --- diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d9a533ccb..64c42ede0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/tools/async_to_sync.py b/tools/async_to_sync.py index 16b67e4da..c748bbe9c 100755 --- a/tools/async_to_sync.py +++ b/tools/async_to_sync.py @@ -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: