pre-commit autoupdate (#3409)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot] 2022-12-06 11:28:47 +01:00 committed by GitHub
parent f8be97c12c
commit 6e4a1f0a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View file

@ -16,11 +16,11 @@ repos:
- --diff
- --check
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint
rev: v2.15.5
rev: v2.15.8
hooks:
- id: pylint
files: ^(telegram|examples)/.*\.py$
@ -38,7 +38,7 @@ repos:
- aiolimiter~=1.0.0
- . # this basically does `pip install -e .`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v0.991
hooks:
- id: mypy
name: mypy-ptb
@ -65,7 +65,7 @@ repos:
- cachetools~=5.2.0
- . # this basically does `pip install -e .`
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.0
hooks:
- id: pyupgrade
files: ^(telegram|examples|tests)/.*\.py$

View file

@ -60,6 +60,7 @@ disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
show_error_codes = True
implicit_optional = True
# For some files, it's easier to just disable strict-optional all together instead of
# cluttering the code with `# type: ignore`s or stuff like

View file

@ -63,8 +63,8 @@ def load_file(
except AttributeError:
return None, cast(Union[bytes, "InputFile", str, Path], obj)
if hasattr(obj, "name") and not isinstance(obj.name, int): # type: ignore[union-attr]
filename = Path(obj.name).name # type: ignore[union-attr]
if hasattr(obj, "name") and not isinstance(obj.name, int):
filename = Path(obj.name).name
else:
filename = None

View file

@ -563,7 +563,7 @@ class ExtBot(Bot, Generic[RLARGS]):
# We build a new result in case the user wants to use the same object in
# different places
new_result = copy(result)
markup = self._replace_keyboard(result.reply_markup) # type: ignore[attr-defined]
markup = self._replace_keyboard(result.reply_markup)
new_result.reply_markup = markup # type: ignore[attr-defined]
results.append(new_result)