Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: export code scanning funcs#162

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SamMorrowDrums merged 2 commits intomainfromexport-code-scanning
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionspkg/github/code_scanning.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ import (
"github.com/mark3labs/mcp-go/server"
)

funcgetCodeScanningAlert(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
funcGetCodeScanningAlert(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("get_code_scanning_alert",
mcp.WithDescription(t("TOOL_GET_CODE_SCANNING_ALERT_DESCRIPTION", "Get details of a specific code scanning alert in a GitHub repository.")),
mcp.WithString("owner",
Expand DownExpand Up@@ -66,7 +66,7 @@ func getCodeScanningAlert(client *github.Client, t translations.TranslationHelpe
}
}

funclistCodeScanningAlerts(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
funcListCodeScanningAlerts(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("list_code_scanning_alerts",
mcp.WithDescription(t("TOOL_LIST_CODE_SCANNING_ALERTS_DESCRIPTION", "List code scanning alerts in a GitHub repository.")),
mcp.WithString("owner",
Expand Down
8 changes: 4 additions & 4 deletionspkg/github/code_scanning_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ import (
func Test_GetCodeScanningAlert(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=getCodeScanningAlert(mockClient, translations.NullTranslationHelper)
tool, _ :=GetCodeScanningAlert(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "get_code_scanning_alert", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -82,7 +82,7 @@ func Test_GetCodeScanningAlert(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=getCodeScanningAlert(client, translations.NullTranslationHelper)
_, handler :=GetCodeScanningAlert(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -118,7 +118,7 @@ func Test_GetCodeScanningAlert(t *testing.T) {
func Test_ListCodeScanningAlerts(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=listCodeScanningAlerts(mockClient, translations.NullTranslationHelper)
tool, _ :=ListCodeScanningAlerts(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "list_code_scanning_alerts", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -201,7 +201,7 @@ func Test_ListCodeScanningAlerts(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=listCodeScanningAlerts(client, translations.NullTranslationHelper)
_, handler :=ListCodeScanningAlerts(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand Down
4 changes: 2 additions & 2 deletionspkg/github/server.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,8 +75,8 @@ func NewServer(client *github.Client, version string, readOnly bool, t translati
s.AddTool(getMe(client, t))

// Add GitHub tools - Code Scanning
s.AddTool(getCodeScanningAlert(client, t))
s.AddTool(listCodeScanningAlerts(client, t))
s.AddTool(GetCodeScanningAlert(client, t))
s.AddTool(ListCodeScanningAlerts(client, t))
return s
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp