Skip to content

Commit

Permalink
ENH: add --keep-pr-linting flag (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Mar 7, 2024
1 parent 7fd733b commit ee94c54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/compwa_policy/check_dev_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions src/compwa_policy/check_dev_files/github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()

Expand Down

0 comments on commit ee94c54

Please sign in to comment.