OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add microsoft/semantic-link-labs --skill code-style
Guide for running code style linters and formatters. Use this when asked to check code style, run linters, or fix formatting issues.
npx skills add microsoft/semantic-link-labs --skill code-style
This skill covers code style checking and formatting workflows for the Semantic Link Labs project.
Use this skill when you need to:
| Tool | Purpose | Configuration |
|---|---|---|
| black | Code formatting | pyproject.toml |
| flake8 | Style checking | pyproject.toml |
| mypy | Type checking | pyproject.toml |
The project uses black for code formatting.
From pyproject.toml, max line length is configured via flake8 settings.
From pyproject.toml:
| Code | Description | Fix |
|---|---|---|
| E501 | Line too long (>200 chars) | Break line or shorten code |
| F401 | Imported but unused | Remove unused import |
| F841 | Variable assigned but never used | Remove or use the variable |
| E302 | Expected 2 blank lines | Add blank lines between functions |
| E303 | Too many blank lines | Remove extra blank lines |
| W291 | Trailing whitespace | Remove trailing spaces |
| E711 | Comparison to None | Use is None instead of == None |
From pyproject.toml:
| Error | Description | Fix |
|---|---|---|
Incompatible types | Type mismatch | Fix type annotation or value |
Missing return statement | Function missing return | Add return statement |
Argument has incompatible type | Wrong argument type | Pass correct type |
has no attribute | Attribute doesn't exist | Check spelling or type |
When mypy raises false positives:
Organize imports in this order (with blank lines between groups):
Before committing code changes:
Break long lines using parentheses or backslash:
Recommended .vscode/settings.json: