feat: Add --force flag to skip pre-push checks

This commit is contained in:
Paul Gauthier (aider) 2025-04-11 08:37:33 +12:00
parent 57304536bf
commit 110c63ae95

View file

@ -81,15 +81,22 @@ def main():
parser.add_argument( parser.add_argument(
"--dry-run", action="store_true", help="Print each step without actually executing them" "--dry-run", action="store_true", help="Print each step without actually executing them"
) )
parser.add_argument(
"--force", action="store_true", help="Skip pre-push checks"
)
args = parser.parse_args() args = parser.parse_args()
dry_run = args.dry_run dry_run = args.dry_run
force = args.force
# Perform checks before proceeding # Perform checks before proceeding unless --force is used
check_branch() if not force:
check_working_directory_clean() check_branch()
check_main_branch_up_to_date() check_working_directory_clean()
check_ok_to_push() check_main_branch_up_to_date()
check_ok_to_push()
else:
print("Skipping pre-push checks due to --force flag.")
new_version_str = args.new_version new_version_str = args.new_version
if not re.match(r"^\d+\.\d+\.\d+$", new_version_str): if not re.match(r"^\d+\.\d+\.\d+$", new_version_str):