スキル一覧に戻る
gpshead

style

by gpshead

8🍴 0📅 2026年1月14日
GitHubで見るManusで実行

SKILL.md


name: style description: Use this skill when preparing commits, running pre-commit hooks, checking code style, or validating changes before pushing. Covers PEP 7 (C code) and PEP 8 (Python) compliance, trailing whitespace rules, the no-type-annotations-in-Lib policy, and patchcheck validation. Note: patchcheck requires a build directory - load the build skill first if you haven't built CPython yet.

CPython Coding Style and Standards

Style Guidelines

Python code (Lib/ etc): Follow PEP 8. Be consistent with nearby code.

C code (Modules/, Objects/, Python/, Include/): Follow PEP 7. Be consistent with nearby code.

Critical Rules

NEVER leave trailing whitespace on any line. Pre-commit hooks will catch this.

ALWAYS preserve the final newline at the end of files.

NEVER add type annotations to Lib/ tree. Stdlib doesn't use inline annotations (maintained in typeshed separately). Annotations may be OK in Tools/ or test code if requested.

No autoformatting by default. Only use Doc/venv/bin/ruff format if explicitly requested.

Pre-Commit Workflow

Before committing, run from repo root:

# 1. Pre-commit hooks (checks whitespace, file endings, syntax)
pre-commit run --all-files

# 2. Patchcheck (MUST PASS - validates C/Python style, docs, whitespace)
make -C $BUILD_DIR patchcheck

# 3. If you modified Doc/, verify reStructuredText
make -C Doc check

# 4. Run relevant tests
$BUILT_PY -m test test_yourmodule -j $(nproc)

Documentation

  • Python docstrings: Follow PEP 257, document params/returns/exceptions
  • C comments: Follow PEP 7, document complex algorithms
  • reStructuredText (Doc/): Follow Sphinx/reST conventions, verify with make -C Doc check

スコア

総合スコア

55/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です