[pre-commit.ci] pre-commit autoupdate (#1993)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by GitHub · parents afb577b, 4b6dac1 · Browse files · 10 files·+11 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+11 added−11 removed
- other:+11 added−11 removed
Provenance
- Commit
9c6c319- Tree
5072784- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
afb577b- Parent 2
4b6dac1
10 files changed+11 added−11 removed
modified:src/jinja2/debug.py+1 added-1 removed
131 unmodified lines132 """Based on the runtime locals, get the context that would be133 available at that point in the template.134 """135 # Start with the current template context.136- ctx: "t.Optional[Context]" = real_locals.get("context")136+ ctx: t.Optional[Context] = real_locals.get("context")137 138 if ctx is not None:139 data: t.Dict[str, t.Any] = ctx.get_all().copy()140 else:32 unmodified linesmodified:src/jinja2/environment.py+1 added-1 removed
1248 unmodified lines1249 environment: Environment,1250 namespace: t.MutableMapping[str, t.Any],1251 globals: t.MutableMapping[str, t.Any],1252 ) -> "Template":1253- t: "Template" = object.__new__(cls)1253+ t: Template = object.__new__(cls)1254 t.environment = environment1255 t.globals = globals1256 t.name = namespace["name"]1257 t.filename = namespace["__file__"]414 unmodified linesmodified:src/jinja2/filters.py+1 added-1 removed
1114 unmodified lines1115 </tr>1116 {%- endfor %}1117 </table>1118 """1119- tmp: "t.List[V]" = []1119+ tmp: t.List[V] = []1120 1121 for item in value:1122 if len(tmp) == linecount:1123 yield tmp743 unmodified linesmodified:src/jinja2/idtracking.py+2 added-2 removed
144 unmodified lines145 self.loads[target] = (VAR_LOAD_RESOLVE, name)146 147 def dump_stores(self) -> t.Dict[str, str]:148 rv: t.Dict[str, str] = {}149- node: t.Optional["Symbols"] = self149+ node: t.Optional[Symbols] = self150 151 while node is not None:152 for name in sorted(node.stores):153 if name not in rv:4 unmodified lines158 return rv159 160 def dump_param_targets(self) -> t.Set[str]:161 rv = set()162- node: t.Optional["Symbols"] = self162+ node: t.Optional[Symbols] = self163 164 while node is not None:165 for target, (instr, _) in self.loads.items():166 if instr == VAR_LOAD_PARAMETER:152 unmodified linesmodified:src/jinja2/lexer.py+1 added-1 removed
327 unmodified lines328 name: t.Optional[str],329 filename: t.Optional[str],330 ):331 self._iter = iter(generator)332- self._pushed: "te.Deque[Token]" = deque()332+ self._pushed: te.Deque[Token] = deque()333 self.name = name334 self.filename = filename335 self.closed = False336 self.current = Token(1, TOKEN_INITIAL, "")532 unmodified linesmodified:src/jinja2/parser.py+1 added-1 removed
62 unmodified lines63 self.name = name64 self.filename = filename65 self.closed = False66 self.extensions: t.Dict[67- str, t.Callable[["Parser"], t.Union[nodes.Node, t.List[nodes.Node]]]67+ str, t.Callable[[Parser], t.Union[nodes.Node, t.List[nodes.Node]]]68 ] = {}69 for extension in environment.iter_extensions():70 for tag in extension.tags:71 self.extensions[tag] = extension.parse970 unmodified linesmodified:src/jinja2/runtime.py+1 added-1 removed
170 unmodified lines171 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,172 ):173 self.parent = parent174 self.vars: t.Dict[str, t.Any] = {}175- self.environment: "Environment" = environment175+ self.environment: Environment = environment176 self.eval_ctx = EvalContext(self.environment, name)177 self.exported_vars: t.Set[str] = set()178 self.name = name179 self.globals_keys = set() if globals is None else set(globals)877 unmodified linesmodified:src/jinja2/sandbox.py+1 added-1 removed
3 unmodified lines4 5 import operator6 import types7 import typing as t8+from _string import formatter_field_name_split # type: ignore9 from collections import abc10 from collections import deque11 from string import Formatter12 12-from _string import formatter_field_name_split # type: ignore13 from markupsafe import EscapeFormatter14 from markupsafe import Markup15 16 from .environment import Environment413 unmodified linesmodified:src/jinja2/utils.py+1 added-1 removed
426 unmodified lines427 428 def __init__(self, capacity: int) -> None:429 self.capacity = capacity430 self._mapping: t.Dict[t.Any, t.Any] = {}431- self._queue: "te.Deque[t.Any]" = deque()431+ self._queue: te.Deque[t.Any] = deque()432 self._postinit()433 434 def _postinit(self) -> None:435 # alias all queue methods for faster lookup320 unmodified linesmodified:.pre-commit-config.yaml+1 added-1 removed
1 ci:2 autoupdate_schedule: monthly3 repos:4 - repo: https://github.com/astral-sh/ruff-pre-commit5- rev: v0.4.45+ rev: v0.4.76 hooks:7 - id: ruff8 - id: ruff-format9 - repo: https://github.com/pre-commit/pre-commit-hooks7 unmodified lines