Back to list
JonathanBechtel

lint-docstrings

by JonathanBechtel

Repository for the Revamped Draft Analytics App

0🍴 0📅 Jan 20, 2026

SKILL.md


name: lint-docstrings description: Review and fix docstrings to follow Google-style conventions. Use when asked to check docstrings, format docstrings, or lint docstrings. allowed-tools: Read, Grep, Glob, Edit

Docstring Linting

Review files for docstring compliance and fix any issues.

Instructions

  1. Find the target files (specified by user, or recently modified files)
  2. Check each public function, class, and method for proper docstrings
  3. Report issues and fix them

Google-Style Docstring Format

Functions

def calculate_percentile(value: float, distribution: list[float]) -> int:
    """Calculate the percentile rank of a value within a distribution.

    Args:
        value: The value to rank.
        distribution: Sorted list of values forming the reference distribution.

    Returns:
        Percentile rank from 0-100.

    Raises:
        ValueError: If distribution is empty.
    """

Rules:

  • First line: imperative summary ending with period
  • Blank line before Args/Returns/Raises sections
  • Args: one line per param, name followed by colon and description
  • Returns: describe the return value (omit if None)
  • Raises: list exceptions that may be raised

Classes

class PlayerMetrics:
    """Container for computed player statistics.

    Holds percentile rankings and z-scores for a player across
    multiple statistical categories.

    Attributes:
        player_id: Unique identifier for the player.
        percentiles: Dict mapping metric names to percentile values.
        computed_at: Timestamp when metrics were calculated.
    """

Simple Functions (no args)

def get_current_timestamp() -> datetime:
    """Return the current UTC timestamp."""

One-liner docstrings: opening and closing quotes on same line.

Test Docstring Format

Tests use a custom format with Fixtures, Scenario, and Expected sections:

def test_player_slug_generation(db_session):
    """Slug is generated from player name on create.

    Fixtures:
        db_session: Clean database session.

    Scenario:
        Create player with name "LeBron James".

    Expected:
        Player.slug equals "lebron-james".
    """
def test_percentile_edge_case_empty_distribution():
    """Percentile calculation handles empty distribution.

    Scenario:
        Call calculate_percentile with empty list.

    Expected:
        Raises ValueError with message about empty distribution.
    """

Rules for tests:

  • First line: concise description of what's being tested
  • Fixtures: list test fixtures/dependencies used (if any)
  • Scenario: describe the setup and action
  • Expected: describe the expected outcome

Checklist

When reviewing, check:

  • All public functions have docstrings
  • First line is imperative mood ("Return", "Calculate", not "Returns", "Calculates")
  • First line ends with period
  • Args section documents all parameters
  • Returns section present (unless function returns None)
  • One-liners fit on single line with quotes
  • Test docstrings follow Fixtures/Scenario/Expected format

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

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

+20
LICENSE

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

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

0/5

Reviews

💬

Reviews coming soon