diff --git a/sanic/cli/arguments.py b/sanic/cli/arguments.py index ad7bb3f72a..84b678a440 100644 --- a/sanic/cli/arguments.py +++ b/sanic/cli/arguments.py @@ -264,8 +264,7 @@ def attach(self): dest="auto_reload", action="store_true", help=( - "Watch source directory for file changes and reload on " - "changes" + "Watch source directory for file changes and reload on changes" ), ) self.container.add_argument( diff --git a/sanic/config.py b/sanic/config.py index bb9b4fb765..afbec99394 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -332,7 +332,7 @@ def load_environment_vars(self, prefix=SANIC_PREFIX): except ValueError: pass - def update_config(self, config: Union[bytes, str, dict, Any]): + def update_config(self, config: Union[bytes, str, dict[str, Any], Any]): """Update app.config. .. note:: diff --git a/sanic/handlers/error.py b/sanic/handlers/error.py index a2afada093..3f58b551ba 100644 --- a/sanic/handlers/error.py +++ b/sanic/handlers/error.py @@ -136,7 +136,7 @@ def response(self, request, exception): except AttributeError: # no cov url = "unknown" response_message = ( - "Exception raised in exception handler " '"%s" for uri: %s' + 'Exception raised in exception handler "%s" for uri: %s' ) error_logger.exception(response_message, handler.__name__, url) diff --git a/sanic/logging/formatter.py b/sanic/logging/formatter.py index 60124e5f08..f6003a5666 100644 --- a/sanic/logging/formatter.py +++ b/sanic/logging/formatter.py @@ -158,7 +158,7 @@ def _color_exception_line(self, line: str) -> str: # no cov return line exc = match.group("exc") message = match.group("message") - return f"{c.SANIC}{c.BOLD}{exc}{c.END}: " f"{c.BOLD}{message}{c.END}" + return f"{c.SANIC}{c.BOLD}{exc}{c.END}: {c.BOLD}{message}{c.END}" def _color_file_line(self, line: str) -> str: # no cov match = FILE_LINE_RE.search(line) diff --git a/sanic/mixins/startup.py b/sanic/mixins/startup.py index 8e8f49678b..c6533eb542 100644 --- a/sanic/mixins/startup.py +++ b/sanic/mixins/startup.py @@ -862,7 +862,7 @@ def get_server_location( if server_settings.get("ssl") is not None: proto = "https" if server_settings.get("unix"): - serve_location = f'{server_settings["unix"]} {proto}://...' + serve_location = f"{server_settings['unix']} {proto}://..." elif server_settings.get("sock"): host, port, *_ = server_settings["sock"].getsockname() diff --git a/sanic/response/convenience.py b/sanic/response/convenience.py index 14003a2f62..cfac3f5f89 100644 --- a/sanic/response/convenience.py +++ b/sanic/response/convenience.py @@ -170,7 +170,7 @@ async def validate_file( if_modified_since = parsedate_to_datetime(if_modified_since) except (TypeError, ValueError): logger.warning( - "Ignorning invalid If-Modified-Since header received: " "'%s'", + "Ignorning invalid If-Modified-Since header received: '%s'", if_modified_since, ) return None