Skip to content

_valid_command_argument #1498

Open
Open
@bearomorphism

Description

@bearomorphism

Description

I just think it's not a good design to validate and reassign things in a function. The function name itself is confusing.

def _valid_command_argument(self):
num_exclusive_args_provided = sum(
arg is not None
for arg in (self.commit_msg_file, self.commit_msg, self.rev_range)
)
if num_exclusive_args_provided == 0 and not sys.stdin.isatty():
self.commit_msg = sys.stdin.read()
elif num_exclusive_args_provided != 1:
raise InvalidCommandArgumentError(
"Only one of --rev-range, --message, and --commit-msg-file is permitted by check command! "
"See 'cz check -h' for more information"
)

Possible Solution

No response

Additional context

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions