From 9ed83dd467c18bcd88d28f1d712842eb18566dfd Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 23 Aug 2024 16:20:08 -0700 Subject: [PATCH] style: Improve readability of conditional expressions --- aider/io.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aider/io.py b/aider/io.py index 07811f914..ad8785e04 100644 --- a/aider/io.py +++ b/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,