Files
acemcp/pyproject.toml
wmymz bb1943e822 ```
style(code): 优化代码导入顺序与 docstring 结构 (main)

调整多个模块的 import 顺序以符合 PEP8 推荐。
在函数和方法的 docstring 中增加空行以提高可读性。
修复部分日志与异常处理的不一致格式。
更新 pyproject.toml 中 ruff 配置,提高圈复杂度阈值。
无功能性变化,仅代码结构与格式优化。
```
2025-11-14 14:58:26 +08:00

115 lines
3.3 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[project]
name = "acemcp"
version = "0.1.6"
description = "MCP server for codebase indexing and semantic search with multi-encoding support and .gitignore integration"
readme = "README.md"
authors = [
{ name = "wmymz", email = "wmymz@icloud.com" }
]
requires-python = ">=3.10"
dependencies = [
"dynaconf>=3.2.12",
"loguru>=0.7.3",
"mcp>=1.1.2",
"httpx[socks]>=0.28.1",
"fastapi>=0.115.6",
"uvicorn[standard]>=0.34.0",
"toml>=0.10.2",
"websockets>=14.1",
"pathspec>=0.12.1",
]
[project.scripts]
acemcp = "acemcp:run"
[build-system]
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"
[dependency-groups]
dev = [
"pip>=25.3",
"pre-commit>=4.3.0",
"ruff>=0.14.3",
]
[tool.ruff]
preview = true
line-length = 320
[tool.ruff.lint]
# pylint规则
# https://pylint.pycqa.org/en/latest/user_guide/messages/messages_overview.html
# pylint规则迁移至uv某些规则不支持部分属于pylint定制化规则非标准
# https://github.com/astral-sh/ruff/issues/970
# https://github.com/astral-sh/ruff/issues/1774
# 基础规则集
select = [
"A", "ARG", "B", "C", "E", "F", "G", "G", "I", "ISC", "N", "PIE", "PLE", "Q", "R", "RET", "SLF", "T", "TID", "UP", "W",
"PLW",
"BLE",
"TRY",
"SIM",
"S",
"FIX",
"PLC",
"PLR",
"D",
]
# 平台检测
# pylint src --disable=import-error,no-member,line-too-long,broad-exception-caught,broad-exception-raised,logging-fstring-interpolation,too-many-positional-arguments,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,too-many-nested-blocks,raise-missing-from,singleton-comparison,too-few-public-methods,consider-iterating-dictionary,consider-using-set-comprehension,not-callable,logging-not-lazy,consider-using-f-string,invalid-name,too-many-public-methods,global-statement,unnecessary-pass,wildcard-import,consider-using-join,cell-var-from-loop,too-many-return-statements,import-outside-toplevel,bare-except,subprocess-run-check,consider-using-dict-items,too-many-boolean-expressions,too-many-lines
# 圈复杂度
mccabe = { max-complexity = 26 }
ignore = [
"BLE001",
"S110",
"PLW0603",
"TRY300",
"TRY004",
"PLC0415",
"TRY002",
"PLC1901",
"TRY003",
"PLR0912",
"S112",
"PLR2004",
"PLR0917",
"PLR0913",
"PLR1702",
"PLR0914",
"PLR0915",
"PLR6301",
"D101",
"PLW2901",
"PLC2701",
"TRY301",
"D205",
"D203", # 和D211不能同时启用这里选择忽略D203
"D213", # 和D212不能同时启用这里选择忽略D213
"D107",
"SIM108",
"FIX002",
"SIM105",
"TRY401",
"S501",
"S324",
"S104",
"D401",
]
[tool.ruff.lint.isort]
# 导入分组顺序(默认:标准库 → 第三方库 → 本地库)
section-order = [
"standard-library", # 标准库(如 sys, os
"third-party", # 第三方库(如 pandas, requests
"first-party", # 本地项目导入
"local-folder", # 同一目录下的本地导入
]
# 允许在导入中使用别名(如 import pandas as pd
force-sort-within-sections = true
split-on-trailing-comma = true # 多行导入时在末尾添加逗号
force-wrap-aliases = true # 强制别名导入使用多行格式(如 import a as b 超过长度时换行)