tessl install tessl/pypi-pep257@0.7.0Python 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%
A utility that runs docstring linting across Python files, exposing exit codes and structured messages for CI or tooling without reimplementing lint rules.
0 with no messages. @test1 and yields a message with the file path and line number of the violation. @test2 and reports the CLI error text. @testrespect_inline_ignore is true, lines marked with # noqa: Dxxx are not reported; when false the same lines produce violations. @testinclude_explanation is true, each message includes the rule explanation text from the linter. @testinclude_source is true, each message includes the offending source snippet. @test@generates
from dataclasses import dataclass
from typing import Iterable, Optional
@dataclass
class LintMessage:
code: str
path: str
line: int
message: str
explanation: Optional[str]
source: Optional[str]
@dataclass
class LintResult:
exit_code: int
messages: list[LintMessage]
def lint_paths(
targets: Iterable[str],
*,
convention: Optional[str] = None,
respect_inline_ignore: bool = True,
include_explanation: bool = False,
include_source: bool = False,
) -> LintResult:
"""
Run the docstring linter over provided files or directories, applying the requested
convention and inline-ignore behavior via the linter dependency. Return structured
messages and the exit code reported by that linter (0 clean, 1 violations, 2 invalid
invocation).
"""Docstring linter CLI used to produce errors, exit codes, explanations, and source snippets.