Skip to content

Commit baa0159

Browse files
authored
Drop Usage of DeepSource (#4100)
1 parent c23eb8e commit baa0159

26 files changed

+45
-68
lines changed

.deepsource.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/auxil/link_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
def _git_branch() -> str:
3737
"""Get's the current git sha if available or fall back to `master`"""
3838
try:
39-
output = subprocess.check_output( # skipcq: BAN-B607
39+
output = subprocess.check_output(
4040
["git", "describe", "--tags", "--always"], stderr=subprocess.STDOUT
4141
)
4242
return output.decode().strip()

telegram/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
def _git_revision() -> Optional[str]:
2929
try:
30-
output = subprocess.check_output( # skipcq: BAN-B607
30+
output = subprocess.check_output(
3131
["git", "describe", "--long", "--tags"], stderr=subprocess.STDOUT
3232
)
3333
except (subprocess.SubprocessError, OSError):
3434
return None
3535
return output.decode().strip()
3636

3737

38-
def print_ver_info() -> None: # skipcq: PY-D0003
38+
def print_ver_info() -> None:
3939
"""Prints version information for python-telegram-bot, the Bot API and Python."""
4040
git_revision = _git_revision()
4141
print(f"python-telegram-bot {telegram_ver}" + (f" ({git_revision})" if git_revision else ""))
@@ -44,7 +44,7 @@ def print_ver_info() -> None: # skipcq: PY-D0003
4444
print(f"Python {sys_version}")
4545

4646

47-
def main() -> None: # skipcq: PY-D0003
47+
def main() -> None:
4848
"""Prints version information for python-telegram-bot, the Bot API and Python."""
4949
print_ver_info()
5050

telegram/_bot.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def _log(func: Any): # type: ignore[no-untyped-def] # skipcq: PY-D0003
532532
async def decorator(self: "Bot", *args: Any, **kwargs: Any) -> Any:
533533
# pylint: disable=protected-access
534534
self._LOGGER.debug("Entering: %s", func.__name__)
535-
result = await func(self, *args, **kwargs) # skipcq: PYL-E1102
535+
result = await func(self, *args, **kwargs)
536536
self._LOGGER.debug(result)
537537
self._LOGGER.debug("Exiting: %s", func.__name__)
538538
return result
@@ -554,7 +554,7 @@ def _parse_file_input(
554554
local_mode=self._local_mode,
555555
)
556556

557-
def _insert_defaults(self, data: Dict[str, object]) -> None: # skipcq: PYL-R0201
557+
def _insert_defaults(self, data: Dict[str, object]) -> None:
558558
"""This method is here to make ext.Defaults work. Because we need to be able to tell
559559
e.g. `send_message(chat_id, text)` from `send_message(chat_id, text, parse_mode=None)`, the
560560
default values for `parse_mode` etc are not `None` but `DEFAULT_NONE`. While this *could*
@@ -2667,7 +2667,7 @@ async def send_chat_action(
26672667
api_kwargs=api_kwargs,
26682668
)
26692669

2670-
def _effective_inline_results( # skipcq: PYL-R0201
2670+
def _effective_inline_results(
26712671
self,
26722672
results: Union[
26732673
Sequence["InlineQueryResult"], Callable[[int], Optional[Sequence["InlineQueryResult"]]]
@@ -5511,7 +5511,6 @@ async def get_custom_emoji_stickers(
55115511
pool_timeout: ODVInput[float] = DEFAULT_NONE,
55125512
api_kwargs: Optional[JSONDict] = None,
55135513
) -> Tuple[Sticker, ...]:
5514-
# skipcq: FLK-D207
55155514
"""
55165515
Use this method to get information about emoji stickers by their identifiers.
55175516
@@ -7904,7 +7903,7 @@ async def get_my_name(
79047903
bot=self,
79057904
)
79067905

7907-
def to_dict(self, recursive: bool = True) -> JSONDict: # skipcq: PYL-W0613
7906+
def to_dict(self, recursive: bool = True) -> JSONDict:
79087907
"""See :meth:`telegram.TelegramObject.to_dict`."""
79097908
data: JSONDict = {"id": self.id, "username": self.username, "first_name": self.first_name}
79107909

telegram/_dice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, value: int, emoji: str, *, api_kwargs: Optional[JSONDict] = N
9898

9999
self._freeze()
100100

101-
DICE: Final[str] = constants.DiceEmoji.DICE # skipcq: PTC-W0052
101+
DICE: Final[str] = constants.DiceEmoji.DICE
102102
""":const:`telegram.constants.DiceEmoji.DICE`"""
103103
DARTS: Final[str] = constants.DiceEmoji.DARTS
104104
""":const:`telegram.constants.DiceEmoji.DARTS`"""

telegram/_keyboardbuttonpolltype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(
5353
self,
5454
type: Optional[str] = None, # pylint: disable=redefined-builtin
5555
*,
56-
api_kwargs: Optional[JSONDict] = None, # skipcq: PYL-W0622
56+
api_kwargs: Optional[JSONDict] = None,
5757
):
5858
super().__init__(api_kwargs=api_kwargs)
5959
self.type: Optional[str] = enum.get_member(PollType, type, type)

telegram/_keyboardbuttonrequest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(
6969
user_is_bot: Optional[bool] = None,
7070
user_is_premium: Optional[bool] = None,
7171
*,
72-
api_kwargs: Optional[JSONDict] = None, # skipcq: PYL-W0622
72+
api_kwargs: Optional[JSONDict] = None,
7373
):
7474
super().__init__(api_kwargs=api_kwargs)
7575
# Required
@@ -164,7 +164,7 @@ def __init__(
164164
bot_administrator_rights: Optional[ChatAdministratorRights] = None,
165165
bot_is_member: Optional[bool] = None,
166166
*,
167-
api_kwargs: Optional[JSONDict] = None, # skipcq: PYL-W0622
167+
api_kwargs: Optional[JSONDict] = None,
168168
):
169169
super().__init__(api_kwargs=api_kwargs)
170170
# required

telegram/_menubutton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MenuButton(TelegramObject):
5757

5858
def __init__(
5959
self,
60-
type: str, # skipcq: PYL-W0622
60+
type: str,
6161
*,
6262
api_kwargs: Optional[JSONDict] = None,
6363
): # pylint: disable=redefined-builtin

telegram/_passport/credentials.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848

4949
@no_type_check
50-
def decrypt(secret, hash, data): # skipcq: PYL-W0622
50+
def decrypt(secret, hash, data):
5151
"""
5252
Decrypt per telegram docs at https://core.telegram.org/passport.
5353
@@ -96,7 +96,7 @@ def decrypt(secret, hash, data): # skipcq: PYL-W0622
9696

9797

9898
@no_type_check
99-
def decrypt_json(secret, hash, data): # skipcq: PYL-W0622
99+
def decrypt_json(secret, hash, data):
100100
"""Decrypts data using secret and hash and then decodes utf-8 string and loads json"""
101101
return json.loads(decrypt(secret, hash, data).decode("utf-8"))
102102

@@ -140,7 +140,7 @@ class EncryptedCredentials(TelegramObject):
140140
def __init__(
141141
self,
142142
data: str,
143-
hash: str, # skipcq: PYL-W0622
143+
hash: str,
144144
secret: str,
145145
*,
146146
api_kwargs: Optional[JSONDict] = None,
@@ -472,7 +472,7 @@ class _CredentialsBase(TelegramObject):
472472

473473
def __init__(
474474
self,
475-
hash: str, # skipcq: PYL-W0622
475+
hash: str,
476476
secret: str,
477477
*,
478478
api_kwargs: Optional[JSONDict] = None,

telegram/_utils/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
user. Changes to this module are not considered breaking changes and may not be documented in
2828
the changelog.
2929
"""
30-
import datetime as dtm # skipcq: PYL-W0406
30+
import datetime as dtm
3131
import time
3232
from typing import TYPE_CHECKING, Optional, Union
3333

0 commit comments

Comments
 (0)