diff --git a/src/compwa_policy/check_dev_files/__init__.py b/src/compwa_policy/check_dev_files/__init__.py index 0929c8fa..110e2791 100644 --- a/src/compwa_policy/check_dev_files/__init__.py +++ b/src/compwa_policy/check_dev_files/__init__.py @@ -66,10 +66,11 @@ def main(argv: Sequence[str] | None = None) -> int: allow_deprecated=args.allow_deprecated_workflows, doc_apt_packages=_to_list(args.doc_apt_packages), github_pages=args.github_pages, - python_version=dev_python_version, + keep_pr_linting=args.keep_pr_linting, no_macos=args.no_macos, no_pypi=args.no_pypi, no_version_branches=args.no_version_branches, + python_version=dev_python_version, single_threaded=args.pytest_single_threaded, skip_tests=_to_list(args.ci_skipped_tests), test_extras=_to_list(args.ci_test_extras), @@ -160,6 +161,12 @@ def _create_argparse() -> ArgumentParser: action="store_true", default=False, ) + parser.add_argument( + "--keep-pr-linting", + help="Do not overwrite the PR linting workflow", + action="store_true", + default=False, + ) parser.add_argument( "--ignore-author", action="store_true", diff --git a/src/compwa_policy/check_dev_files/github_workflows.py b/src/compwa_policy/check_dev_files/github_workflows.py index 7903df35..cbbbffe7 100644 --- a/src/compwa_policy/check_dev_files/github_workflows.py +++ b/src/compwa_policy/check_dev_files/github_workflows.py @@ -29,10 +29,12 @@ from ruamel.yaml.main import YAML -def main( # noqa: PLR0917 +def main( + *, allow_deprecated: bool, doc_apt_packages: list[str], github_pages: bool, + keep_pr_linting: bool, no_macos: bool, no_pypi: bool, no_version_branches: bool, @@ -54,7 +56,8 @@ def main( # noqa: PLR0917 skip_tests, test_extras, ) - executor(_update_pr_linting) + if not keep_pr_linting: + executor(_update_pr_linting) executor(_recommend_vscode_extension) executor.finalize()