Skip to content

Commit ae56477

Browse files
authored
added minor type hinting (#3024)
* added minor type hinting * apply linter
1 parent a575f5c commit ae56477

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

sanic/cli/arguments.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ def attach(self):
264264
dest="auto_reload",
265265
action="store_true",
266266
help=(
267-
"Watch source directory for file changes and reload on "
268-
"changes"
267+
"Watch source directory for file changes and reload on changes"
269268
),
270269
)
271270
self.container.add_argument(

sanic/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def load_environment_vars(self, prefix=SANIC_PREFIX):
332332
except ValueError:
333333
pass
334334

335-
def update_config(self, config: Union[bytes, str, dict, Any]):
335+
def update_config(self, config: Union[bytes, str, dict[str, Any], Any]):
336336
"""Update app.config.
337337
338338
.. note::

sanic/handlers/error.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def response(self, request, exception):
136136
except AttributeError: # no cov
137137
url = "unknown"
138138
response_message = (
139-
"Exception raised in exception handler " '"%s" for uri: %s'
139+
'Exception raised in exception handler "%s" for uri: %s'
140140
)
141141
error_logger.exception(response_message, handler.__name__, url)
142142

sanic/logging/formatter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _color_exception_line(self, line: str) -> str: # no cov
158158
return line
159159
exc = match.group("exc")
160160
message = match.group("message")
161-
return f"{c.SANIC}{c.BOLD}{exc}{c.END}: " f"{c.BOLD}{message}{c.END}"
161+
return f"{c.SANIC}{c.BOLD}{exc}{c.END}: {c.BOLD}{message}{c.END}"
162162

163163
def _color_file_line(self, line: str) -> str: # no cov
164164
match = FILE_LINE_RE.search(line)

sanic/mixins/startup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def get_server_location(
862862
if server_settings.get("ssl") is not None:
863863
proto = "https"
864864
if server_settings.get("unix"):
865-
serve_location = f'{server_settings["unix"]} {proto}://...'
865+
serve_location = f"{server_settings['unix']} {proto}://..."
866866
elif server_settings.get("sock"):
867867
host, port, *_ = server_settings["sock"].getsockname()
868868

sanic/response/convenience.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ async def validate_file(
170170
if_modified_since = parsedate_to_datetime(if_modified_since)
171171
except (TypeError, ValueError):
172172
logger.warning(
173-
"Ignorning invalid If-Modified-Since header received: " "'%s'",
173+
"Ignorning invalid If-Modified-Since header received: '%s'",
174174
if_modified_since,
175175
)
176176
return None

0 commit comments

Comments
 (0)