Skip to content

Commit

Permalink
🐛 fix: 更新配置文件,添加开发依赖项并修复代码格式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvandia committed Nov 29, 2024
1 parent 4187cdc commit 5b191ba
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ show-source = true
statistics = true
max-line-length = 127
max-complexity = 10
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1 # 使用一个稳定的版本标签,而不是具体的提交哈希
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .pdm-python
Original file line number Diff line number Diff line change
@@ -1 +1 @@
E:/nb-plugin/nonebot-plugin-fakemsg/.venv/Scripts/python.EXE
E:/nb-plugin/nonebot-plugin-fakemsg/.venv/Scripts/python.EXE
22 changes: 21 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,24 @@ repos:
rev: 24.10.0
hooks:
- id: black
stages: [pre-commit]
stages: [pre-commit]

#pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=100]
- id: check-toml
- id: end-of-file-fixer



- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion nonebot_plugin_fakemsg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


async def check_if_fakemsg(
event: Union[GroupMessageEvent, PrivateMessageEvent]
event: Union[GroupMessageEvent, PrivateMessageEvent],
) -> bool:
"""
检查是否为伪造消息
Expand Down
8 changes: 4 additions & 4 deletions nonebot_plugin_fakemsg/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from nonebot import get_driver
from pydantic import BaseModel, Extra
from nonebot.plugin import get_plugin_config
from pydantic import BaseModel


class Config(BaseModel, extra=Extra.ignore):
class Config(BaseModel):
user_split: str = "|"
message_split: str = " "


config = Config.parse_obj(get_driver().config.dict())
config = get_plugin_config(Config)
193 changes: 191 additions & 2 deletions pdm.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ requires-python = "<4,>=3.8"
readme = "README.md"
license = {text = "MIT"}

[dependency-groups]
dev = ["ruff>=0.8.1", "pre-commit>=3.5.0"]

0 comments on commit 5b191ba

Please sign in to comment.