CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pep257

tessl install tessl/pypi-pep257@0.7.0

Python docstring style checker for PEP 257 compliance

Agent Success

Agent success rate when using this tile

72%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.04x

Baseline

Agent success rate without this tile

69%

task.mdevals/scenario-2/

Docstring Rule Selector

Build a small CLI that lints Python files while allowing callers to pick which docstring rules are applied through conventions and fine-grained rule filters.

Capabilities

Convention-based defaults

  • When no selection flags are given, linting uses the default pep257 convention and reports violations from that rule set when files break them. @test

Custom selects and ignores

  • --select replaces the base rules with the provided comma-separated codes and --add-select appends extra codes; the combined list is deduplicated and sorted lexicographically. Violations are reported only for that final list. @test
  • --ignore removes codes from either the convention defaults or the select list, and --add-ignore removes extra codes after additions. For example, --convention google --add-ignore D400 suppresses punctuation reports but still checks other Google rules. @test

Selection preview

  • Passing --show-selection prints the final rule codes (comma-separated, lexicographic order) before linting when any selection or ignore flags are used. @test

Exit status

  • Linting returns status 0 when no violations remain after filtering and 1 when any violation is found. @test

Implementation

@generates

API

from typing import List, Optional

def build_selection(
    convention: Optional[str],
    select: Optional[List[str]],
    ignore: Optional[List[str]],
    add_select: Optional[List[str]],
    add_ignore: Optional[List[str]],
) -> List[str]:
    """Return the ordered rule codes after applying base convention, select override, additions, and ignores."""

def run_lint(paths: List[str], selection: List[str], show_selection: bool = False) -> int:
    """
    Lint provided files or directories with the given rule selection, optionally printing the final codes.
    Returns process-style status: 0 when no violations, 1 otherwise.
    """

def main(argv: Optional[List[str]] = None) -> int:
    """
    CLI entrypoint that parses --convention, --select, --ignore, --add-select,
    --add-ignore, --show-selection, and file/directory arguments, then runs linting.
    """

Dependencies { .dependencies }

pydocstyle { .dependency }

Provides docstring linting with conventions and rule selection controls.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pep257@0.7.x
tile.json