Skip to content

Commit 1c6949e

Browse files
choieastseahalucinor
authored andcommitted
feat: add ruff (#3)
1 parent 654afee commit 1c6949e

File tree

8 files changed

+57
-3
lines changed

8 files changed

+57
-3
lines changed

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies = [
88
"mcp[cli]>=1.12.0",
99
"openstacksdk>=4.6.0",
1010
"pydantic>=2.11.7",
11+
"ruff>=0.12.5",
1112
]
1213

1314
[project.dependency-group]
@@ -29,3 +30,24 @@ testpaths = ["tests"]
2930
python_files = ["test_*.py", "*_test.py"]
3031
python_classes = ["Test*"]
3132
python_functions = ["test_*"]
33+
34+
35+
[tool.ruff]
36+
line-length = 79
37+
38+
[tool.ruff.format]
39+
quote-style = "double"
40+
indent-style = "space"
41+
line-ending = "auto"
42+
docstring-code-format = true
43+
44+
[tool.ruff.lint]
45+
select = ["C", "E", "F", "S", "U", "I"]
46+
ignore = ["C901", "E501"]
47+
48+
[tool.ruff.lint.isort]
49+
lines-after-imports = 2
50+
no-sections = true
51+
52+
[tool.ruff.lint.pydocstyle]
53+
convention = "google"

src/openstack_mcp_server/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import sys
2-
import signal
31
import argparse
42
import logging
3+
import signal
4+
import sys
5+
56

67
# Configure root logger
78
logging.basicConfig(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from openstack_mcp_server import main
22

3+
34
main()

src/openstack_mcp_server/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
from pathlib import Path
33

4+
45
# Transport protocol
56
MCP_TRANSPORT = os.environ.get("TRANSPORT", "stdio")
67

src/openstack_mcp_server/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from mcp.server.fastmcp import FastMCP
22
from openstack_mcp_server.tools import register_tool
33

4+
45
def serve(transport: str, **kwargs):
56
"""Serve the MCP server with the specified transport."""
67
mcp = FastMCP("openstack_mcp_server")

src/openstack_mcp_server/tools/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mcp.server.fastmcp import FastMCP
22

3+
34
def register_tool(mcp : FastMCP):
45
"""
56
Register Openstack MCP tools.

src/openstack_mcp_server/tools/nova_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from mcp.server.fastmcp import FastMCP
21
import openstack
2+
from mcp.server.fastmcp import FastMCP
33

44

55
class NovaTools:

uv.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)