linting

对 Python 代码进行静态分析与风格检查,自动识别语法错误、代码异味及格式问题,并支持一键修复可纠正的规范问题,提升代码一致性与可维护性。

快捷安装

在终端运行此命令,即可一键安装该 Skill 到您的 Claude 中

npx skills add OpenHands/software-agent-sdk --skill "linting"

Python Linting Skill

This skill provides instructions for linting Python code using ruff.

How to Lint

Run ruff to check for issues:

ruff check .

To automatically fix issues:

ruff check --fix .

Common Options

  • --select E,W - Only check for errors and warnings
  • --ignore E501 - Ignore line length errors
  • --fix - Automatically fix fixable issues

Example Output

example.py:1:1: F401 [*] `os` imported but unused
example.py:5:5: E302 Expected 2 blank lines, found 1
Found 2 errors (1 fixable).