Skip to content

Commit 51ed2e4

Browse files
authored
docs: 使用 AutoCorrect 格式化文档 (#165)
1 parent 7432509 commit 51ed2e4

File tree

28 files changed

+72
-887
lines changed

28 files changed

+72
-887
lines changed

.github/workflows/lint-other.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@ jobs:
3232

3333
- run: pnpm run eslint
3434

35-
zhlint:
35+
markdownlint:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v4
3939

4040
- name: Setup Node
4141
uses: ./.github/actions/setup-node
4242

43-
- run: pnpm run zhlint
43+
- run: pnpm run markdownlint
44+
45+
autocorrect:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- uses: huacnlee/autocorrect-action@main

alicebot/adapter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async def safe_run(self) -> None:
8787
async def run(self) -> None:
8888
"""适配器运行方法,适配器开发者必须实现该方法。
8989
90-
适配器运行过程中保持保持运行,当此方法结束后, AliceBot 不会自动重新启动适配器。
90+
适配器运行过程中保持保持运行,当此方法结束后,AliceBot 不会自动重新启动适配器。
9191
"""
9292
raise NotImplementedError
9393

alicebot/bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ async def handle_event(
478478
handle_get: bool = True,
479479
show_log: bool = True,
480480
) -> None:
481-
"""被适配器对象调用,根据优先级分发事件给所有插件,并处理插件的 `stop``skip` 等信号。
481+
"""被适配器对象调用,根据优先级分发事件给所有插件,并处理插件的 `stop``skip` 等信号。
482482
483483
此方法不应该被用户手动调用。
484484
@@ -812,7 +812,7 @@ def _load_plugins_from_dirs(self, *dirs: Path) -> None:
812812
813813
Args:
814814
*dirs: 储存包含插件的模块的模块路径。
815-
例如:`pathlib.Path("path/of/plugins/")`
815+
例如:`pathlib.Path("path/of/plugins/")`。
816816
"""
817817
dir_list = [str(x.resolve()) for x in dirs]
818818
logger.info("Loading plugins from dirs", dirs=", ".join(map(str, dir_list)))
@@ -828,7 +828,7 @@ def load_plugins_from_dirs(self, *dirs: Path) -> None:
828828
829829
Args:
830830
*dirs: 储存包含插件的模块的模块路径。
831-
例如:`pathlib.Path("path/of/plugins/")`
831+
例如:`pathlib.Path("path/of/plugins/")`。
832832
"""
833833
self._extend_plugin_dirs.extend(dirs)
834834
self._load_plugins_from_dirs(*dirs)

alicebot/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""AliceBot 异常。
22
3-
下列是 AliceBot 运行过程中可能会抛出的异常。这些异常大部分不需要用户处理, AliceBot 会自动捕获并处理。
4-
对于适配器开发者,所有适配器抛出的异常都应该继承自 `AdapterException`
3+
下列是 AliceBot 运行过程中可能会抛出的异常。这些异常大部分不需要用户处理,AliceBot 会自动捕获并处理。
4+
对于适配器开发者,所有适配器抛出的异常都应该继承自 `AdapterException`。
55
"""
66

77
__all__ = [

alicebot/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def values(self) -> ValuesView[Any]:
483483

484484
@override
485485
def items(self) -> ItemsView[str, Any]:
486-
"""返回由 `data` 字典项 (`(键, 值)` 对) 组成的一个新视图。"""
486+
"""返回由 `data` 字典项 (`(键值)` 对) 组成的一个新视图。"""
487487
return self.data.items()
488488

489489
def is_text(self) -> bool:

alicebot/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def samefile(path1: StrOrBytesPath, path2: StrOrBytesPath) -> bool:
163163
"""一个 `os.path.samefile` 的简单包装。
164164
165165
Args:
166-
path1: 路径1
167-
path2: 路径2
166+
path1: 路径 1
167+
path2: 路径 2
168168
169169
Returns:
170170
如果两个路径是否指向相同的文件或目录。

docs/api/adapter/apscheduler/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ APScheduler 配置类,将在适配器被加载时被混入到机器人主配
4545

4646
适配器运行方法,适配器开发者必须实现该方法。
4747

48-
适配器运行过程中保持保持运行,当此方法结束后, AliceBot 不会自动重新启动适配器。
48+
适配器运行过程中保持保持运行,当此方法结束后,AliceBot 不会自动重新启动适配器。
4949

5050
- **Returns**
5151

docs/api/adapter/cqhttp/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ CQHTTP 配置类,将在适配器被加载时被混入到机器人主配置中
6565

6666
- **NetworkError** - 网络错误。
6767

68-
- **ApiNotAvailable** - API 请求响应 404, API 不可用。
68+
- **ApiNotAvailable** - API 请求响应 404,API 不可用。
6969

70-
- **ActionFailed** - API 请求响应 failed, API 操作失败。
70+
- **ActionFailed** - API 请求响应 failed,API 操作失败。
7171

7272
- **ApiTimeout** - API 请求响应超时。
7373

@@ -131,7 +131,7 @@ CQHTTP 配置类,将在适配器被加载时被混入到机器人主配置中
131131

132132
- **message\_type** (_Literal\['private', 'group'\]_) - 消息类型。应该是 "private" 或者 "group"。
133133

134-
- **id\_** (_int_) - 发送对象的 ID, QQ 号码或者群号码。
134+
- **id\_** (_int_) - 发送对象的 ID,QQ 号码或者群号码。
135135

136136
- **Returns**
137137

docs/api/adapter/dingtalk/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ DingTalk 配置类,将在适配器被加载时被混入到机器人主配置
7171

7272
适配器运行方法,适配器开发者必须实现该方法。
7373

74-
适配器运行过程中保持保持运行,当此方法结束后, AliceBot 不会自动重新启动适配器。
74+
适配器运行过程中保持保持运行,当此方法结束后,AliceBot 不会自动重新启动适配器。
7575

7676
- **Returns**
7777

docs/api/adapter/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Type: _~ConfigT_
7070

7171
适配器运行方法,适配器开发者必须实现该方法。
7272

73-
适配器运行过程中保持保持运行,当此方法结束后, AliceBot 不会自动重新启动适配器。
73+
适配器运行过程中保持保持运行,当此方法结束后,AliceBot 不会自动重新启动适配器。
7474

7575
- **Returns**
7676

0 commit comments

Comments
 (0)