mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
style: Improve readability of conditional expressions
This commit is contained in:
parent
2643cc8643
commit
9ed83dd467
1 changed files with 8 additions and 2 deletions
10
aider/io.py
10
aider/io.py
|
@ -401,10 +401,16 @@ class InputOutput:
|
|||
style = dict()
|
||||
|
||||
def is_valid_response(text):
|
||||
valid_responses = ["y", "n", "s", ""] if explicit_yes_required else ["y", "n", "a", "s", ""]
|
||||
valid_responses = (
|
||||
["y", "n", "s", ""] if explicit_yes_required else ["y", "n", "a", "s", ""]
|
||||
)
|
||||
return text.lower()[0] in valid_responses
|
||||
|
||||
error_message = "Please answer Yes, No, or Skip all." if explicit_yes_required else "Please answer Yes, No, All, or Skip all."
|
||||
error_message = (
|
||||
"Please answer Yes, No, or Skip all."
|
||||
if explicit_yes_required
|
||||
else "Please answer Yes, No, All, or Skip all."
|
||||
)
|
||||
validator = Validator.from_callable(
|
||||
is_valid_response,
|
||||
error_message=error_message,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue