Overview
- Skill Key
- genify/lsp-python
- Author
- genify
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/genify/lsp-python
- Latest Commit SHA
- 7cbfc3fa7c13e8c4e4cab6c7c3d1882206f83898
Python code quality checking and LSP integration using pylsp. Provides code diagnostics, completion, hover tips, and style analysis. Use when: checking Python errors/warnings, getting code completions, viewing function signatures, analyzing code quality, or fixing style issues.
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 lsp-python 技能。 若已安装,则直接安装 lsp-python 技能。
# LSP Python 技能 使用 Python Language Server Protocol (LSP) 进行代码质量检查和智能分析。 ## 快速开始 ### 1. 检查代码问题 ```bash # 单个文件 python3 scripts/lsp-service.py check <文件路径> # 批量检查 (推荐) python3 scripts/check_python.py <文件或目录> # 批量检查并自动修复 python3 scripts/check_python.py --auto-fix <文件或目录> ``` 示例: ```bash python3 scripts/lsp-service.py check my_script.py python3 scripts/check_python.py src/ python3 scripts/check_python.py --auto-fix src/ ``` ### 2. 获取代码补全 ```bash python3 scripts/lsp-service.py complete <文件> <行号> <字符位置> ``` ### 3. 查看符号信息 ```bash python3 scripts/lsp-service.py info <文件> <行号> <字符位置> ``` ## 依赖 - **Python 3.x** - **pylsp**: `pip install python-lsp-server` - **可选插件**: - `pip install python-lsp-server[all]` - 完整插件集 - `pip install pylsp-mypy` - 类型检查 - `pip install pylsp-black` - black 格式化 ## 核心功能 ### 代码诊断 (check) 检查 Python 文件中的错误和警告: - **pyflakes** - 代码错误检测 (未使用导入、未定义变量等) - **pycodestyle** - PEP8 风格检查 (格式、行长、空白等) 输出示例: ``` ⚠️ 第 3 行 [pyflakes]: 'os' imported but unused ⚠️ 第 6 行 [pycodestyle]: E302 expected 2 blank lines, found 1 ✅ 没有发现问题 ``` ### 代码补全 (complete) 获取指定位置的代码补全建议: ```bash python3 scripts/lsp-service.py complete script.py 5 10 ``` 输出: ``` 补全建议: • json (模块) • jsonpatch (模块) • requests (模块) ``` ### 悬停提示 (info) 查看函数签名、文档字符串等信息: ```bash python3 scripts/lsp-service.py info script.py 10 5 ``` ### 跳转定义 (goto) 查找符号的定义位置: ```bash python3 scripts/lsp-service.py goto script.py 15 10 ``` ## 自动修复代码问题 ### 清理未使用的导入 ```bash pip install autoflake autoflake --remove-all-unused-imports --in-place --recursive . ``` ### 格式化代码 ```bash pip install black black . ``` ### 完整修复流程 ```bash # 1. 备份 cp -r project/ project.backup # 2. 清理导入 autoflake --remove-all-unused-imports --in-place --r...
capt-marbles
Task Router
capncoconut
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
capevace
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
captchasco
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.
carol-gutianle
name: modelready description: Start using a local or Hugging Face model instantly, directly from chat. metadata: {"openclaw":{"requires":{"bins": "bash", "curl" }, "env": "URL" }}
canbirlik
Controls Wiz smart bulbs (turn on/off, RGB colors, disco mode) via local WiFi.