LCORE-643: don't store None value in boolean CLI option#507
Conversation
WalkthroughUpdated argparse defaults in src/lightspeed_stack.py: the verbose and dump-configuration flags now default to False instead of None, keeping store_true flags consistently boolean. No other logic or public signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/lightspeed_stack.py (3)
28-35: Nit:default=Falseis redundant forstore_true; also tighten help.Argparse already defaults
store_trueto False. Consider dropping the explicit default and clarifying the help text."-v", "--verbose", dest="verbose", - help="make it verbose", + help="Enable verbose logging", action="store_true", - default=False, )
36-43: Nit: same here—drop redundant default; clarify help."-d", "--dump-configuration", dest="dump_configuration", - help="dump actual configuration into JSON file and quit", + help="Dump effective configuration to configuration.json and exit", action="store_true", - default=False, )
28-35: Optional: wire-v/--verboseto logging level.If desired, bump log verbosity when the flag is set.
Add after Line 59 (right after
args = parser.parse_args()):if args.verbose: logging.getLogger().setLevel(logging.DEBUG) for h in logging.getLogger().handlers: h.setLevel(logging.DEBUG)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/lightspeed_stack.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-pr
🔇 Additional comments (2)
src/lightspeed_stack.py (2)
28-35: Correct: store_true flags now stay boolean (no None).This aligns with argparse semantics and keeps downstream checks like
if args.dump_configuration:correct.Also applies to: 36-43
28-35: Sanity check: ensure nothing relied on a None sentinel.Search for ‘is None/!= None’ checks or Optional[bool] annotations on these flags to avoid behavior drift.
#!/bin/bash set -euo pipefail # Look for None-sentinel usage of CLI flags rg -nP -C2 '\bargs\.(verbose|dump_configuration)\s+is\s+None' rg -nP -C2 '\bargs\.(verbose|dump_configuration)\s+is\s+not\s+None' rg -nP -C2 '\bargs\.(verbose|dump_configuration)\s*==\s*None' rg -nP -C2 '\bargs\.(verbose|dump_configuration)\s*!=\s*None' # Optional/typing clues rg -nP -C2 'Optional\s*\[\s*bool\s*\].*\b(verbose|dump_configuration)\b'Also applies to: 36-43
Description
LCORE-643: don't store
Nonevalue in boolean CLI optionType of change
Related Tickets & Documents
Summary by CodeRabbit