Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce sort-all Hook for pre-commit #4052

Merged
merged 2 commits into from Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -88,3 +88,9 @@ repos:
- APScheduler~=3.10.4
- cachetools~=5.3.2
- aiolimiter~=1.1.0
- repo: https://github.com/aio-libs/sort-all/
rev: v1.2.0
hooks:
- id: sort-all
name: sort-all
files: ^(telegram|examples|tests)/.*\.py$
26 changes: 13 additions & 13 deletions telegram/__init__.py
Expand Up @@ -21,10 +21,6 @@
__author__ = "devs@python-telegram-bot.org"

__all__ = ( # Keep this alphabetically ordered
"__bot_api_version__",
"__bot_api_version_info__",
"__version__",
"__version_info__",
"Animation",
"Audio",
"Bot",
Expand All @@ -48,26 +44,24 @@
"ChatJoinRequest",
"ChatLocation",
"ChatMember",
"ChatMemberOwner",
"ChatMemberAdministrator",
"ChatMemberBanned",
"ChatMemberLeft",
"ChatMemberMember",
"ChatMemberOwner",
"ChatMemberRestricted",
"ChatMemberLeft",
"ChatMemberBanned",
"ChatMemberUpdated",
"ChatPermissions",
"ChatPhoto",
"ChatShared",
"ChosenInlineResult",
"constants",
"Contact",
"Credentials",
"DataCredentials",
"Dice",
"Document",
"EncryptedCredentials",
"EncryptedPassportElement",
"error",
"File",
"FileCredentials",
"ForceReply",
Expand All @@ -80,7 +74,6 @@
"GameHighScore",
"GeneralForumTopicHidden",
"GeneralForumTopicUnhidden",
"helpers",
"IdDocumentData",
"InlineKeyboardButton",
"InlineKeyboardMarkup",
Expand All @@ -103,10 +96,10 @@
"InlineQueryResultLocation",
"InlineQueryResultMpeg4Gif",
"InlineQueryResultPhoto",
"InlineQueryResultsButton",
"InlineQueryResultVenue",
"InlineQueryResultVideo",
"InlineQueryResultVoice",
"InlineQueryResultsButton",
"InputContactMessageContent",
"InputFile",
"InputInvoiceMessageContent",
Expand Down Expand Up @@ -160,7 +153,6 @@
"ProximityAlertTriggered",
"ReplyKeyboardMarkup",
"ReplyKeyboardRemove",
"request",
"ResidentialAddress",
"SecureData",
"SecureValue",
Expand All @@ -186,11 +178,19 @@
"VideoChatStarted",
"VideoNote",
"Voice",
"warnings",
"WebAppData",
"WebAppInfo",
"WebhookInfo",
"WriteAccessAllowed",
"__bot_api_version__",
"__bot_api_version_info__",
"__version__",
"__version_info__",
"constants",
"error",
"helpers",
"request",
"warnings",
)


Expand Down
2 changes: 1 addition & 1 deletion telegram/_version.py
Expand Up @@ -19,7 +19,7 @@
# pylint: disable=missing-module-docstring
from typing import Final, NamedTuple

__all__ = ("__version__", "__version_info__", "__bot_api_version__", "__bot_api_version_info__")
__all__ = ("__bot_api_version__", "__bot_api_version_info__", "__version__", "__version_info__")


class Version(NamedTuple):
Expand Down
6 changes: 3 additions & 3 deletions telegram/constants.py
Expand Up @@ -58,8 +58,8 @@
"InlineKeyboardMarkupLimit",
"InlineQueryLimit",
"InlineQueryResultLimit",
"InlineQueryResultsButtonLimit",
"InlineQueryResultType",
"InlineQueryResultsButtonLimit",
"InputMediaType",
"InvoiceLimit",
"LocationLimit",
Expand All @@ -70,19 +70,19 @@
"MessageEntityType",
"MessageLimit",
"MessageType",
"PollingLimit",
"ParseMode",
"PollLimit",
"PollType",
"PollingLimit",
"ReplyLimit",
"SUPPORTED_WEBHOOK_PORTS",
"StickerFormat",
"StickerLimit",
"StickerSetLimit",
"StickerType",
"WebhookLimit",
"UpdateType",
"UserProfilePhotosLimit",
"WebhookLimit",
]

import sys
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/__init__.py
Expand Up @@ -39,7 +39,6 @@
"Defaults",
"DictPersistence",
"ExtBot",
"filters",
"InlineQueryHandler",
"InvalidCallbackData",
"Job",
Expand All @@ -57,6 +56,7 @@
"StringRegexHandler",
"TypeHandler",
"Updater",
"filters",
)

from . import filters
Expand Down
8 changes: 4 additions & 4 deletions telegram/ext/filters.py
Expand Up @@ -65,24 +65,24 @@
"IS_TOPIC_MESSAGE",
"LOCATION",
"Language",
"MessageFilter",
"Mention",
"MessageFilter",
"PASSPORT_DATA",
"PHOTO",
"POLL",
"PREMIUM_USER",
"REPLY",
"Regex",
"Sticker",
"STORY",
"SUCCESSFUL_PAYMENT",
"SuccessfulPayment",
"SenderChat",
"StatusUpdate",
"Sticker",
"SuccessfulPayment",
"TEXT",
"Text",
"USER",
"USER_ATTACHMENT",
"PREMIUM_USER",
"UpdateFilter",
"UpdateType",
"User",
Expand Down