mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 06:25:12 +01:00
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:
parent
f8be97c12c
commit
6e4a1f0a21
4 changed files with 8 additions and 7 deletions
|
@ -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$
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue