Introduce sort-all Hook for pre-commit (#4052)

This commit is contained in:
Bibo-Joshi 2024-01-08 18:35:32 +01:00 committed by GitHub
parent 979988add1
commit dc284a1a73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 23 deletions

View file

@ -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$

View file

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

View file

@ -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):

View file

@ -58,8 +58,8 @@ __all__ = [
"InlineKeyboardMarkupLimit",
"InlineQueryLimit",
"InlineQueryResultLimit",
"InlineQueryResultsButtonLimit",
"InlineQueryResultType",
"InlineQueryResultsButtonLimit",
"InputMediaType",
"InvoiceLimit",
"LocationLimit",
@ -70,19 +70,19 @@ __all__ = [
"MessageEntityType",
"MessageLimit",
"MessageType",
"PollingLimit",
"ParseMode",
"PollLimit",
"PollType",
"PollingLimit",
"ReplyLimit",
"SUPPORTED_WEBHOOK_PORTS",
"StickerFormat",
"StickerLimit",
"StickerSetLimit",
"StickerType",
"WebhookLimit",
"UpdateType",
"UserProfilePhotosLimit",
"WebhookLimit",
]
import sys

View file

@ -39,7 +39,6 @@ __all__ = (
"Defaults",
"DictPersistence",
"ExtBot",
"filters",
"InlineQueryHandler",
"InvalidCallbackData",
"Job",
@ -57,6 +56,7 @@ __all__ = (
"StringRegexHandler",
"TypeHandler",
"Updater",
"filters",
)
from . import filters

View file

@ -65,24 +65,24 @@ __all__ = (
"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",