From c8a954073ff6a46a598ba2957119868b01bc4c64 Mon Sep 17 00:00:00 2001 From: Azide Date: Thu, 15 Aug 2024 23:04:37 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E6=8C=89ruff=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9ruff=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`: - 'ignore' -> 'lint.ignore' - 'select' -> 'lint.select' --- .pre-commit-config.yaml | 2 +- pyproject.toml | 7 ++++--- tests/platforms/test_rss.py | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 051b1520..96b3f95d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks" repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.6.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index 6f975843..cdc0ef1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,12 +95,13 @@ markers = [ asyncio_mode = "auto" [tool.ruff] -select = ["E", "W", "F", "UP", "C", "T", "PYI", "PT", "Q"] -ignore = ["E402", "C901", "PT023"] - line-length = 120 target-version = "py310" +[tool.ruff.lint] +select = ["E", "W", "F", "UP", "C", "T", "PYI", "PT", "Q"] +ignore = ["E402", "C901", "PT023"] + [tool.black] line-length = 120 preview = true diff --git a/tests/platforms/test_rss.py b/tests/platforms/test_rss.py index 6f291cc8..2d5b7922 100644 --- a/tests/platforms/test_rss.py +++ b/tests/platforms/test_rss.py @@ -14,7 +14,7 @@ pass -@pytest.fixture() +@pytest.fixture def dummy_user(app: App): from nonebot_bison.types import User @@ -22,7 +22,7 @@ def dummy_user(app: App): return user -@pytest.fixture() +@pytest.fixture def user_info_factory(app: App, dummy_user): from nonebot_bison.types import UserSubInfo @@ -32,7 +32,7 @@ def _user_info(category_getter, tag_getter): return _user_info -@pytest.fixture() +@pytest.fixture def rss(app: App): from nonebot_bison.platform import platform_manager from nonebot_bison.utils import ProcessContext, DefaultClientManager @@ -40,7 +40,7 @@ def rss(app: App): return platform_manager["rss"](ProcessContext(DefaultClientManager())) -@pytest.fixture() +@pytest.fixture def update_time_feed_1(): file = get_file("rss-twitter-ArknightsStaff.xml") root = ET.fromstring(file) @@ -53,7 +53,7 @@ def update_time_feed_1(): return ET.tostring(root, encoding="unicode") -@pytest.fixture() +@pytest.fixture def update_time_feed_2(): file = get_file("rss-ruanyifeng.xml") root = ET.fromstring(file) @@ -119,7 +119,7 @@ async def test_fetch_new_2( assert post1.content == "这里记录每周值得分享的科技内容,周五发布。..." -@pytest.fixture() +@pytest.fixture def update_time_feed_3(): file = get_file("rss-github-atom.xml") root = ET.fromstring(file)