diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2e38476e..6268424a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: repos: - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black args: @@ -17,7 +17,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/PyCQA/pylint - rev: v3.0.0a7 + rev: v3.0.0 hooks: - id: pylint files: ^(telegram|examples)/.*\.py$ @@ -62,7 +62,7 @@ repos: - cachetools~=5.3.1 - . # this basically does `pip install -e .` - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.13.0 hooks: - id: pyupgrade files: ^(telegram|examples|tests|docs)/.*\.py$ @@ -77,7 +77,7 @@ repos: - --diff - --check - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.0.287' + rev: 'v0.0.292' hooks: - id: ruff name: ruff diff --git a/pyproject.toml b/pyproject.toml index d7e3672a3..46efd078b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,9 @@ target-version = "py38" show-fixes = true ignore = ["PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "PERF203"] select = ["E", "F", "I", "PL", "UP", "RUF", "PTH", "C4", "B", "PIE", "SIM", "RET", "RSE", - "G", "ISC", "PT", "ASYNC", "TCH", "CPY", "SLOT", "PERF", "PYI"] + "G", "ISC", "PT", "ASYNC", "TCH", "SLOT", "PERF", "PYI", "FLY", "AIR"] +# Add "FURB" after it's out of preview [tool.ruff.per-file-ignores] "tests/*.py" = ["B018"] -"**/__init__.py" = ["CPY001"] -"examples/**.py" = ["CPY001"] "tests/**.py" = ["RUF012"] diff --git a/tests/_inline/test_inlinekeyboardbutton.py b/tests/_inline/test_inlinekeyboardbutton.py index 15c7ef8bf..96cf4c153 100644 --- a/tests/_inline/test_inlinekeyboardbutton.py +++ b/tests/_inline/test_inlinekeyboardbutton.py @@ -36,12 +36,16 @@ def inline_keyboard_button(): url=TestInlineKeyboardButtonBase.url, callback_data=TestInlineKeyboardButtonBase.callback_data, switch_inline_query=TestInlineKeyboardButtonBase.switch_inline_query, - switch_inline_query_current_chat=TestInlineKeyboardButtonBase.switch_inline_query_current_chat, # noqa: E501 + switch_inline_query_current_chat=( + TestInlineKeyboardButtonBase.switch_inline_query_current_chat + ), callback_game=TestInlineKeyboardButtonBase.callback_game, pay=TestInlineKeyboardButtonBase.pay, login_url=TestInlineKeyboardButtonBase.login_url, web_app=TestInlineKeyboardButtonBase.web_app, - switch_inline_query_chosen_chat=TestInlineKeyboardButtonBase.switch_inline_query_chosen_chat, # noqa: E501 + switch_inline_query_chosen_chat=( + TestInlineKeyboardButtonBase.switch_inline_query_chosen_chat + ), ) diff --git a/tests/_inline/test_inputinvoicemessagecontent.py b/tests/_inline/test_inputinvoicemessagecontent.py index c399c49aa..1503fc967 100644 --- a/tests/_inline/test_inputinvoicemessagecontent.py +++ b/tests/_inline/test_inputinvoicemessagecontent.py @@ -43,7 +43,9 @@ def input_invoice_message_content(): need_phone_number=TestInputInvoiceMessageContentBase.need_phone_number, need_email=TestInputInvoiceMessageContentBase.need_email, need_shipping_address=TestInputInvoiceMessageContentBase.need_shipping_address, - send_phone_number_to_provider=TestInputInvoiceMessageContentBase.send_phone_number_to_provider, # noqa: E501 + send_phone_number_to_provider=( + TestInputInvoiceMessageContentBase.send_phone_number_to_provider + ), send_email_to_provider=TestInputInvoiceMessageContentBase.send_email_to_provider, is_flexible=TestInputInvoiceMessageContentBase.is_flexible, )