lint_tonel_smalltalk
Analyze Tonel Smalltalk source code from a content string to detect linting issues and ensure code quality.
Instructions
Lint Tonel formatted Smalltalk source code from content string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_content | Yes | The Tonel file content as a string |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Implementation of lint_tonel_smalltalk_impl - the core handler that creates a TonelCSTLinter, runs lint checks on content string, converts issues to dicts, and returns results with success, content_length, issue_list, warnings_count, errors_count.
def lint_tonel_smalltalk_impl(file_content: str) -> dict[str, Any]: """ Lint Tonel formatted Smalltalk source code from content string. Args: file_content: The Tonel file content as a string Returns: Dictionary with lint results including issues found """ try: linter = TonelCSTLinter() issues = linter.lint(file_content) issue_list = _convert_lint_issues_to_dicts(issues) return { "success": True, "content_length": len(file_content), "issue_list": issue_list, "warnings_count": linter.warnings, "errors_count": linter.errors, "issues_count": len(issue_list), } except Exception as e: return { "success": False, "error": f"Linting failed: {str(e)}", "content_length": len(file_content), "exception": type(e).__name__, } - Implementation of lint_tonel_smalltalk_from_file_impl - core handler that reads file then lints it using TonelCSTLinter.
def lint_tonel_smalltalk_from_file_impl(file_path: str) -> dict[str, Any]: """ Lint Tonel formatted Smalltalk source code from a file. Args: file_path: Path to the Tonel file to lint Returns: Dictionary with lint results including issues found """ try: if not os.path.exists(file_path): return { "success": False, "error": f"File not found: {file_path}", "file_path": file_path, } linter = TonelCSTLinter() issues = linter.lint_from_file(Path(file_path)) issue_list = _convert_lint_issues_to_dicts(issues) return { "success": True, "file_path": file_path, "issue_list": issue_list, "warnings_count": linter.warnings, "errors_count": linter.errors, "issues_count": len(issue_list), } except Exception as e: return { "success": False, "error": f"Linting failed: {str(e)}", "file_path": file_path, "exception": type(e).__name__, } - smalltalk_validator_mcp_server/server.py:87-98 (registration)MCP tool registration: @app.tool('lint_tonel_smalltalk') registers the FastMCP tool that delegates to lint_tonel_smalltalk_impl.
@app.tool("lint_tonel_smalltalk") def lint_tonel_smalltalk(_: Context, file_content: str) -> dict[str, Any]: """ Lint Tonel formatted Smalltalk source code from content string. Args: file_content: The Tonel file content as a string Returns: Dictionary with lint results including issues found """ return lint_tonel_smalltalk_impl(file_content) - smalltalk_validator_mcp_server/server.py:73-84 (registration)MCP tool registration: @app.tool('lint_tonel_smalltalk_from_file') registers the file-based lint tool, delegating to lint_tonel_smalltalk_from_file_impl.
@app.tool("lint_tonel_smalltalk_from_file") def lint_tonel_smalltalk_from_file(_: Context, file_path: str) -> dict[str, Any]: """ Lint Tonel formatted Smalltalk source code from a file. Args: file_path: Path to the Tonel file to lint Returns: Dictionary with lint results including issues found """ return lint_tonel_smalltalk_from_file_impl(file_path) - Schema/type info for lint_tonel_smalltalk: accepts file_content: str, returns dict[str, Any].
def lint_tonel_smalltalk(_: Context, file_content: str) -> dict[str, Any]: """ Lint Tonel formatted Smalltalk source code from content string. Args: