feat: add --skip-sanity-check-repo switch

This commit is contained in:
Paul Gauthier (aider) 2024-10-01 17:31:34 -07:00
parent 72cb5db530
commit 510fa24ade
2 changed files with 9 additions and 2 deletions

View file

@ -502,6 +502,12 @@ def get_parser(default_config_files, git_root):
default=False,
help="Perform a dry run without modifying files (default: False)",
)
group.add_argument(
"--skip-sanity-check-repo",
action="store_true",
help="Skip the sanity check for the git repository (default: False)",
default=False,
)
group = parser.add_argument_group("Fixing and committing")
group.add_argument(
"--lint",

View file

@ -584,8 +584,9 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
except FileNotFoundError:
pass
if not sanity_check_repo(repo, io):
return 1
if not args.skip_sanity_check_repo:
if not sanity_check_repo(repo, io):
return 1
commands = Commands(
io, None, verify_ssl=args.verify_ssl, args=args, parser=parser, verbose=args.verbose