Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#786)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and asvetlov authored Nov 29, 2024
1 parent 671f0d6 commit f05685d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
rev: 'v5.0.0'
hooks:
- id: check-merge-conflict
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/PyCQA/isort
rev: '5.12.0'
rev: '5.13.2'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '23.11.0'
rev: '24.10.0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
rev: 'v5.0.0'
hooks:
- id: end-of-file-fixer
exclude: >-
Expand Down Expand Up @@ -46,12 +46,12 @@ repos:
- id: detect-private-key
exclude: ^examples/
- repo: https://github.com/PyCQA/flake8
rev: '6.1.0'
rev: '7.1.1'
hooks:
- id: flake8
exclude: "^docs/"
- repo: https://github.com/asottile/pyupgrade
rev: 'v3.15.0'
rev: 'v3.19.0'
hooks:
- id: pyupgrade
args: ['--py36-plus']
Expand Down
18 changes: 6 additions & 12 deletions aiohttp_jinja2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,17 @@ class _TemplateWrapper(Protocol):
@overload
def __call__(
self, func: _SimpleTemplateHandler
) -> Callable[[web.Request], Awaitable[web.StreamResponse]]:
...
) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ...

@overload
def __call__(
self, func: Callable[[_AbstractView], _TemplateReturnType]
) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]:
...
) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ...

@overload
def __call__(
self, func: Callable[[_T, web.Request], _TemplateReturnType]
) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]:
...
) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ...


def setup(
Expand Down Expand Up @@ -203,20 +200,17 @@ def template(
@overload
def wrapper(
func: _SimpleTemplateHandler,
) -> Callable[[web.Request], Awaitable[web.StreamResponse]]:
...
) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ...

@overload
def wrapper(
func: Callable[[_AbstractView], _TemplateReturnType]
) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]:
...
) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ...

@overload
def wrapper(
func: Callable[[_T, web.Request], _TemplateReturnType]
) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]:
...
) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ...

def wrapper(
func: Callable[..., _TemplateReturnType]
Expand Down
1 change: 1 addition & 0 deletions aiohttp_jinja2/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
useful context functions, see
http://jinja.pocoo.org/docs/dev/api/#jinja2.contextfunction
"""

import warnings
from typing import Dict, Optional, TypedDict, Union

Expand Down
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ include_trailing_comma=True
multi_line_output=3
force_grid_wrap=0
combine_as_imports=True

[flake8]
extend-select =
B950,
# NIC001 -- "Implicitly concatenated str literals on one line"
NIC001,
# NIC101 -- "Implicitly concatenated bytes literals on one line"
NIC101,
# TODO: don't disable D*, fix up issues instead
ignore = N801,N802,N803,NIC002,NIC102,E203,E226,E305,W504,E252,E301,E302,E501,E704,W503,W504,D1,D4
max-line-length = 88

0 comments on commit f05685d

Please sign in to comment.