Skip to content

change some desc #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mcp_server/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
logger = logging.getLogger(consts.LOGGER_NAME)

core.load()
server = Server("mcp-simple-resource")
server = Server("qiniu-mcp-server")


@server.set_logging_level()
async def set_logging_level(level: LoggingLevel) -> EmptyResult:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function or method docstring (missing-function-docstring)

Details

lint 解释

missing-function-docstring 是一个常见的代码质量检查,用于确保函数或方法有文档字符串(docstring)。文档字符串是用于描述函数、类或模块用途的字符串,通常放在函数定义的第一行。它有助于其他开发者理解代码的功能和使用方式。

错误用法

以下是一个缺少函数文档字符串的示例:

def calculate_area(length, width):
    return length * width

在这个例子中,calculate_area 函数没有文档字符串,这可能会导致其他开发者难以理解该函数的作用。

正确用法

以下是添加了文档字符串的正确示例:

def calculate_area(length, width):
    """
    计算矩形面积
    
    参数:
    length (float): 矩形的长度
    width (float): 矩形的宽度
    
    返回:
    float: 矩形的面积
    """
    return length * width

在这个例子中,calculate_area 函数添加了一个文档字符串,详细描述了函数的功能、参数和返回值。这有助于提高代码的可读性和可维护性。


💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流

logger.setLevel(level.lower())
await server.request_context.session.send_log_message(
level="warning", data=f"Log level set to {level}", logger="mcp_s3_server"
level="warning", data=f"Log level set to {level}", logger=consts.LOGGER_NAME
)
return EmptyResult()

Expand Down
4 changes: 2 additions & 2 deletions mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
logger.info("Starting MCP server")

SAMPLE_RESOURCES = {
"greeting": "Hello! This is a resource for qiniu.",
"help": "This server provides a few resources for qiniu.",
"greeting": "Hello! This is a MCP Server for Qiniu.",
"help": "This server provides a few resources and tools for Qiniu.",
"about": "This is the MCP server implementation.",
}

Expand Down
Loading