store_true does not need default=...

This commit is contained in:
anthony sottile 2025-09-06 14:20:01 -04:00
parent e70b313c80
commit e671830402

View file

@ -62,10 +62,10 @@ def _add_hook_type_option(parser: argparse.ArgumentParser) -> None:
def _add_run_options(parser: argparse.ArgumentParser) -> None: def _add_run_options(parser: argparse.ArgumentParser) -> None:
parser.add_argument('hook', nargs='?', help='A single hook-id to run') parser.add_argument('hook', nargs='?', help='A single hook-id to run')
parser.add_argument('--verbose', '-v', action='store_true', default=False) parser.add_argument('--verbose', '-v', action='store_true')
mutex_group = parser.add_mutually_exclusive_group(required=False) mutex_group = parser.add_mutually_exclusive_group(required=False)
mutex_group.add_argument( mutex_group.add_argument(
'--all-files', '-a', action='store_true', default=False, '--all-files', '-a', action='store_true',
help='Run on all the files in the repo.', help='Run on all the files in the repo.',
) )
mutex_group.add_argument( mutex_group.add_argument(
@ -275,7 +275,7 @@ def main(argv: Sequence[str] | None = None) -> int:
) )
_add_hook_type_option(install_parser) _add_hook_type_option(install_parser)
install_parser.add_argument( install_parser.add_argument(
'--allow-missing-config', action='store_true', default=False, '--allow-missing-config', action='store_true',
help=( help=(
'Whether to allow a missing `pre-commit` configuration file ' 'Whether to allow a missing `pre-commit` configuration file '
'or exit with a failure code.' 'or exit with a failure code.'