Skip to content

Commit

Permalink
🔧 按ruff建议修改ruff配置
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
AzideCupric committed Aug 15, 2024
1 parent 94a28bc commit c8a9540
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/platforms/test_rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
pass


@pytest.fixture()
@pytest.fixture
def dummy_user(app: App):
from nonebot_bison.types import User

user = User(123, "group")
return user


@pytest.fixture()
@pytest.fixture
def user_info_factory(app: App, dummy_user):
from nonebot_bison.types import UserSubInfo

Expand All @@ -32,15 +32,15 @@ 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

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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c8a9540

Please sign in to comment.