fix: make -m/--mode a required argument#34
Merged
Adamtaranto merged 1 commit intoFeb 12, 2026
Conversation
When no -m flag is provided, args.mode is None (since action='append' defaults to None). This causes a TypeError in print_summary() which iterates over args.mode. Mark the argument as required=True so argparse emits a clear usage error instead of crashing with an unhelpful traceback. Also remove "[default]" from the help text for mode 0 since there is no longer a default. Fixes #32 Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
|
Thanks. I will test and check if any of the docs need updating. |
There was a problem hiding this comment.
Pull request overview
This PR addresses a CLI crash path where omitting -m/--mode leaves args.mode=None, causing print_summary() to throw a TypeError. It makes -m/--mode an argparse-required option so the CLI fails fast with a clear usage error instead of crashing later.
Changes:
- Mark
-m/--modeasrequired=Truewhile keepingaction='append'for multi-mode support. - Adjust the
--modehelp text to remove the misleading “[default]” wording.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When no
-mflag is provided,args.modeisNone(sinceaction='append'defaults toNonerather than an empty list). This causes aTypeError: 'NoneType' object is not iterableinprint_summary()at line 87 ofutils/checks.py.Changes
required=Trueto the-m/--modeargument inparse_args()[default]from the help text for mode 0 (there is no default when the argument is required)Behavior
Before:
After:
Test Plan
flexidot -i input.fastawithout-m: now shows a clear argparse error instead of crashingflexidot -i input.fasta -m 0: unchanged behaviorflexidot -i input.fasta -m 0 -m 2: multiple modes still work viaaction='append'Fixes #32