Skip to content

Commit

Permalink
Fix for boolean handling of install_precommit user answer
Browse files Browse the repository at this point in the history
  • Loading branch information
GenevieveBuckley committed Nov 1, 2023
1 parent 5451181 commit 4761716
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions _tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def initialize_new_repository(
parser.add_argument("--install_precommit",
dest="install_precommit",
help="Install pre-commit",
default=False)
default="False")
parser.add_argument("--github_repository_url",
dest="github_repository_url",
help="Github repository URL",
Expand All @@ -217,11 +217,17 @@ def initialize_new_repository(
default='githubuser')
args = parser.parse_args()

# Since bool("False") returns True, we need to check the actual string value
if args.install_precommit.lower() == "true":
install_precommit = True
else:
install_precommit = False

module_name_pep8_compliance(args.module_name)
pypi_package_name_compliance(args.plugin_name)
validate_manifest(args.module_name, args.project_directory)
msg = initialize_new_repository(
install_precommit=bool(args.install_precommit),
install_precommit=install_precommit,
plugin_name=args.plugin_name,
github_repository_url=args.github_repository_url,
github_username_or_organization=args.github_username_or_organization,
Expand Down

0 comments on commit 4761716

Please sign in to comment.