Skip to main content

code-style

Python code style and formatting standards using Ruff. Use when writing or reviewing Python code.

소스 정보

저장소
meleantonio/ChernyCode
최근 소스 활동
2026년 2월 1일 11:23
감지된 SKILL.md 언어
영어
스타
517
포크
108

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
code-style
description
Python code style and formatting standards using Ruff. Use when writing or reviewing Python code.
# Python Code Style ## Formatting - Use Ruff for formatting (`ruff format .`) - Indentation: 4 spaces - Max line length: 120 characters - Use trailing commas in multi-line collections ## Naming Conventions - Functions and variables: `snake_case` - Classes: `PascalCase` - Constants: `UPPER_SNAKE_CASE` - Private members: `_leading_underscore` - Module files: `snake_case.py` ## Type Hints - Required for all function parameters and return types - Use `Optional[T]` or `T | None` for nullable types - Use `list[T]`, `dict[K, V]` (lowercase) for Python 3.10+ ## Docstrings - Use Google-style docstrings - Required for all public functions, classes, and modules - Include Args, Returns, and Raises sections Example: ```python def calculate_total(items: list[Item], discount: float = 0.0) -> float: """Calculate the total price of items with optional discount. Args: items: List of items to calculate total for. discount: Discount percentage to apply (0.0 to 1.0). Returns: The total price after discount. Raises: ValueError: If discount is not between 0 and 1. """ ``` ## Imports - Sort with Ruff (replaces isort) - Group: stdlib, third-party, local - Use absolute imports for clarity - Avoid wildcard imports (`from x import *`) ## Commands - Format: `ruff format .` - Lint: `ruff check .` - Fix: `ruff check --fix .`
GitHub에서 보기