Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions git_pw/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ def cli(
"""
logger.configure_verbosity(debug)

CONF.debug = debug
CONF.token = token
CONF.username = username
CONF.password = password
CONF.server = server
CONF.project = project
if debug:
CONF.debug = debug
if token:
CONF.token = token
if username:
CONF.username = username
if password:
CONF.password = password
if server:
CONF.server = server
if project:
CONF.project = project
Comment on lines +100 to +111
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make these explicit None checks rather than false'y? You will also need to change the default for --debug to None and update the hint to bool | None

Suggested change
if debug:
CONF.debug = debug
if token:
CONF.token = token
if username:
CONF.username = username
if password:
CONF.password = password
if server:
CONF.server = server
if project:
CONF.project = project
if debug is not None:
CONF.debug = debug
if token is not None:
CONF.token = token
if username is not None:
CONF.username = username
if password is not None:
CONF.password = password
if server is not None:
CONF.server = server
if project is not None:
CONF.project = project

I also wonder if it's possible to add a small test to prevent this regressing?



@cli.group()
Expand Down
Loading