- Port Go comment-checker to TypeScript using web-tree-sitter - Support 38 programming languages via tree-sitter-wasms - Filter out valid comments: BDD patterns, lint directives, docstrings, shebangs - Integrate with OpenCode's tool.execute.before/after hooks - Attach feedback to Write/Edit/MultiEdit tool output
12 lines
374 B
TypeScript
12 lines
374 B
TypeScript
import type { FileComments } from "../types"
|
|
import { HOOK_MESSAGE_HEADER } from "../constants"
|
|
import { buildCommentsXml } from "./xml-builder"
|
|
|
|
export function formatHookMessage(fileCommentsList: FileComments[]): string {
|
|
if (fileCommentsList.length === 0) {
|
|
return ""
|
|
}
|
|
const xml = buildCommentsXml(fileCommentsList)
|
|
return `${HOOK_MESSAGE_HEADER}${xml}\n`
|
|
}
|