diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1919300..75ee38f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.11.4 hooks: - id: ruff args: diff --git a/hooks/generate_files.py b/hooks/generate_files.py index d0212c5..f8b4418 100644 --- a/hooks/generate_files.py +++ b/hooks/generate_files.py @@ -36,9 +36,9 @@ def main() -> None: catalog = get_location_catalog(docs_dir) # 为了控制显示顺序,人为指定 locations locations = ["北京", "京外"] - assert ( - len(locations) == len(catalog) - ), "人为规定的`locations`数量应当与实际相同。如果您给某个`university/*.md`加了新的`location`,应当更新`locations`。" + assert len(locations) == len(catalog), ( + "人为规定的`locations`数量应当与实际相同。如果您给某个`university/*.md`加了新的`location`,应当更新`locations`。" + ) with mkdocs_gen_files.open("SUMMARY.md", "w") as f: # Used by mkdocs-literate-nav tab = " " * 4 diff --git a/hooks/macros.py b/hooks/macros.py index 9419c68..bab28de 100644 --- a/hooks/macros.py +++ b/hooks/macros.py @@ -13,7 +13,7 @@ def still_migrating(): return f""" !!! warning ":material-file-move-outline: 仍在迁移" - 此文档尚未完成迁移,排版可能不正常。建议您暂时参阅[**:material-file-document-outline:原先的飞书版本**]({env.page.meta['feishu_url']})。 + 此文档尚未完成迁移,排版可能不正常。建议您暂时参阅[**:material-file-document-outline:原先的飞书版本**]({env.page.meta["feishu_url"]})。 如果您有兴趣帮助迁移,可以[:material-file-edit-outline:编辑此页]({env.page.edit_url})。 (记得到 [:octicons-issue-opened-24:议题#6](https://github.com/Scholar-Compass/content/issues/6) 说一声,以免和同学撞车。)