mirror of https://github.com/scrapy/scrapy.git
Add typing to scrapy/utils/template.py.
This commit is contained in:
parent
b8277f4cab
commit
c04b9ba19d
|
|
@ -4,10 +4,10 @@ import re
|
|||
import string
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
from typing import Any, Union
|
||||
|
||||
|
||||
def render_templatefile(path: Union[str, PathLike], **kwargs):
|
||||
def render_templatefile(path: Union[str, PathLike], **kwargs: Any) -> None:
|
||||
path_obj = Path(path)
|
||||
raw = path_obj.read_text("utf8")
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ def render_templatefile(path: Union[str, PathLike], **kwargs):
|
|||
CAMELCASE_INVALID_CHARS = re.compile(r"[^a-zA-Z\d]")
|
||||
|
||||
|
||||
def string_camelcase(string):
|
||||
def string_camelcase(string: str) -> str:
|
||||
"""Convert a word to its CamelCase version and remove invalid chars
|
||||
|
||||
>>> string_camelcase('lost-pound')
|
||||
|
|
|
|||
Loading…
Reference in New Issue