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 - APScheduler~=3.10.4
- cachetools~=5.3.2 - cachetools~=5.3.2
- aiolimiter~=1.1.0 - 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" __author__ = "devs@python-telegram-bot.org"
__all__ = ( # Keep this alphabetically ordered __all__ = ( # Keep this alphabetically ordered
"__bot_api_version__",
"__bot_api_version_info__",
"__version__",
"__version_info__",
"Animation", "Animation",
"Audio", "Audio",
"Bot", "Bot",
@ -48,18 +44,17 @@ __all__ = ( # Keep this alphabetically ordered
"ChatJoinRequest", "ChatJoinRequest",
"ChatLocation", "ChatLocation",
"ChatMember", "ChatMember",
"ChatMemberOwner",
"ChatMemberAdministrator", "ChatMemberAdministrator",
"ChatMemberMember",
"ChatMemberRestricted",
"ChatMemberLeft",
"ChatMemberBanned", "ChatMemberBanned",
"ChatMemberLeft",
"ChatMemberMember",
"ChatMemberOwner",
"ChatMemberRestricted",
"ChatMemberUpdated", "ChatMemberUpdated",
"ChatPermissions", "ChatPermissions",
"ChatPhoto", "ChatPhoto",
"ChatShared", "ChatShared",
"ChosenInlineResult", "ChosenInlineResult",
"constants",
"Contact", "Contact",
"Credentials", "Credentials",
"DataCredentials", "DataCredentials",
@ -67,7 +62,6 @@ __all__ = ( # Keep this alphabetically ordered
"Document", "Document",
"EncryptedCredentials", "EncryptedCredentials",
"EncryptedPassportElement", "EncryptedPassportElement",
"error",
"File", "File",
"FileCredentials", "FileCredentials",
"ForceReply", "ForceReply",
@ -80,7 +74,6 @@ __all__ = ( # Keep this alphabetically ordered
"GameHighScore", "GameHighScore",
"GeneralForumTopicHidden", "GeneralForumTopicHidden",
"GeneralForumTopicUnhidden", "GeneralForumTopicUnhidden",
"helpers",
"IdDocumentData", "IdDocumentData",
"InlineKeyboardButton", "InlineKeyboardButton",
"InlineKeyboardMarkup", "InlineKeyboardMarkup",
@ -103,10 +96,10 @@ __all__ = ( # Keep this alphabetically ordered
"InlineQueryResultLocation", "InlineQueryResultLocation",
"InlineQueryResultMpeg4Gif", "InlineQueryResultMpeg4Gif",
"InlineQueryResultPhoto", "InlineQueryResultPhoto",
"InlineQueryResultsButton",
"InlineQueryResultVenue", "InlineQueryResultVenue",
"InlineQueryResultVideo", "InlineQueryResultVideo",
"InlineQueryResultVoice", "InlineQueryResultVoice",
"InlineQueryResultsButton",
"InputContactMessageContent", "InputContactMessageContent",
"InputFile", "InputFile",
"InputInvoiceMessageContent", "InputInvoiceMessageContent",
@ -160,7 +153,6 @@ __all__ = ( # Keep this alphabetically ordered
"ProximityAlertTriggered", "ProximityAlertTriggered",
"ReplyKeyboardMarkup", "ReplyKeyboardMarkup",
"ReplyKeyboardRemove", "ReplyKeyboardRemove",
"request",
"ResidentialAddress", "ResidentialAddress",
"SecureData", "SecureData",
"SecureValue", "SecureValue",
@ -186,11 +178,19 @@ __all__ = ( # Keep this alphabetically ordered
"VideoChatStarted", "VideoChatStarted",
"VideoNote", "VideoNote",
"Voice", "Voice",
"warnings",
"WebAppData", "WebAppData",
"WebAppInfo", "WebAppInfo",
"WebhookInfo", "WebhookInfo",
"WriteAccessAllowed", "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 # pylint: disable=missing-module-docstring
from typing import Final, NamedTuple 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): class Version(NamedTuple):

View file

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

View file

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

View file

@ -65,24 +65,24 @@ __all__ = (
"IS_TOPIC_MESSAGE", "IS_TOPIC_MESSAGE",
"LOCATION", "LOCATION",
"Language", "Language",
"MessageFilter",
"Mention", "Mention",
"MessageFilter",
"PASSPORT_DATA", "PASSPORT_DATA",
"PHOTO", "PHOTO",
"POLL", "POLL",
"PREMIUM_USER",
"REPLY", "REPLY",
"Regex", "Regex",
"Sticker",
"STORY", "STORY",
"SUCCESSFUL_PAYMENT", "SUCCESSFUL_PAYMENT",
"SuccessfulPayment",
"SenderChat", "SenderChat",
"StatusUpdate", "StatusUpdate",
"Sticker",
"SuccessfulPayment",
"TEXT", "TEXT",
"Text", "Text",
"USER", "USER",
"USER_ATTACHMENT", "USER_ATTACHMENT",
"PREMIUM_USER",
"UpdateFilter", "UpdateFilter",
"UpdateType", "UpdateType",
"User", "User",