{
  "markdown": "[![CI](https://img.shields.io/github/actions/workflow/status/Alberto-Codes/docvet/ci.yml?branch=main)](https://github.com/Alberto-Codes/docvet/actions/workflows/ci.yml)\n[![Coverage](https://codecov.io/gh/Alberto-Codes/docvet/graph/badge.svg)](https://codecov.io/gh/Alberto-Codes/docvet)\n[![PyPI](https://img.shields.io/pypi/v/docvet)](https://pypi.org/project/docvet/)\n[![Python](https://img.shields.io/pypi/pyversions/docvet)](https://pypi.org/project/docvet/)\n[![License](https://img.shields.io/pypi/l/docvet)](https://github.com/Alberto-Codes/docvet/blob/main/LICENSE)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![docs vetted](https://img.shields.io/badge/docs%20vetted-docvet-purple)](https://github.com/Alberto-Codes/docvet)\n\n# docvet\n\n**Better docstrings, better AI.**\n\n## Why docvet?\n\nruff checks how your docstrings look. interrogate checks if they exist (but is unmaintained). docvet checks if they're right — and now covers presence too. Existing tools cover style; docvet delivers the layers they miss:\n\n| Layer | Check | ruff | interrogate | pydoclint | **docvet** |\n|-------|-------|------|-------------|-----------|------------|\n| 1. Presence | \"Does a docstring exist?\" | -- | Yes (unmaintained) | -- | **Yes** |\n| 2. Style | \"Is it formatted correctly?\" | Yes | -- | -- | -- |\n| 3. Completeness | \"Does it have all required sections?\" | -- | -- | Partial | **Yes** |\n| 4. Accuracy | \"Does it match the current code?\" | -- | -- | -- | **Yes** |\n| 5. Rendering | \"Will mkdocs render it correctly?\" | -- | -- | -- | **Yes** |\n| 6. Visibility | \"Will mkdocs even see the file?\" | -- | -- | -- | **Yes** |\n\n**pydoclint** covers 3 structural categories (Args, Returns, Raises). docvet's enrichment alone has 20 rules, including Raises, Yields, Receives, Warns, Attributes, Examples, cross-references, parameter agreement, and more. Add presence (coverage metrics + threshold enforcement), freshness (git diff/blame staleness detection), griffe rendering compatibility, and mkdocs coverage: 31 rules across 5 checks, in territory no other tool touches.\n\n**[Quickstart](#quickstart)** | **[GitHub Action](#github-action)** | **[Pre-commit](#pre-commit)** | **[Configuration](#configuration)** | **[AI Agent Integration](#ai-agent-integration)** | **[Docs](https://alberto-codes.github.io/docvet/)**\n\n## What It Checks\n\n**Presence** (existence) -- 2 rules:\n`missing-docstring` `overload-has-docstring`\n\n**Enrichment** (completeness) -- 20 rules:\n`missing-raises` `missing-returns` `missing-yields` `missing-receives` `missing-warns` `missing-deprecation` `missing-param-in-docstring` `extra-param-in-docstring` `missing-other-parameters` `missing-attributes` `undocumented-init-params` `missing-typed-attributes` `missing-examples` `missing-cross-references` `extra-raises-in-docstring` `extra-yields-in-docstring` `extra-returns-in-docstring` `missing-return-type` `trivial-docstring` `prefer-fenced-code-blocks`\n\n**Freshness** (accuracy) -- 5 rules:\n`stale-signature` `stale-body` `stale-import` `stale-drift` `stale-age`\n\n**Griffe** (rendering) -- 3 rules:\n`griffe-unknown-param` `griffe-missing-type` `griffe-format-warning`\n\n**Coverage** (visibility) -- 1 rule:\n`missing-init`\n\n## Quickstart\n\n```bash\npip install docvet && docvet check --all\n```\n\nFor optional griffe rendering checks:\n\n```bash\npip install docvet[griffe]\n```\n\nExample output:\n\n```\nsrc/mypackage/helpers.py:1: missing-docstring Module has no docstring [required]\nsrc/mypackage/utils.py:42: missing-raises Function 'parse_config' raises ValueError but has no Raises section [required]\nsrc/mypackage/models.py:15: stale-signature Function 'process' signature changed but docstring not updated [required]\nsrc/mypackage/api.py:1: missing-init Package directory missing __init__.py (invisible to mkdocs) [required]\n```\n\n## Configuration\n\nConfigure via `[tool.docvet]` in your `pyproject.toml`. All checks run and print findings. Checks listed in `fail-on` cause a non-zero exit code; unlisted checks are treated as warnings.\n\n```toml\n[tool.docvet]\nexclude = [\"tests\", \"scripts\"]\nfail-on = [\"griffe\", \"coverage\"]\n\n[tool.docvet.freshness]\ndrift-threshold = 30\nage-threshold = 90\n```\n\n## Pre-commit\n\nAdd to your `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n  - repo: https://github.com/Alberto-Codes/docvet\n    rev: v1.2.0\n    hooks:\n      - id: docvet\n```\n\nFor griffe rendering checks, add the optional dependency:\n\n```yaml\nrepos:\n  - repo: https://github.com/Alberto-Codes/docvet\n    rev: v1.2.0\n    hooks:\n      - id: docvet\n        additional_dependencies: [griffe]\n```\n\n## GitHub Action\n\nAdd docvet to your GitHub Actions workflow — findings appear as inline annotations on your PR:\n\n```yaml\n- uses: Alberto-Codes/docvet@v1\n```\n\nSelect specific checks or pin a version:\n\n```yaml\n- uses: Alberto-Codes/docvet@v1\n  with:\n    checks: 'enrichment,freshness'\n    docvet-version: '1.9.0'\n    python-version: '3.13'\n```\n\nFor griffe rendering checks, install griffe before running docvet:\n\n```yaml\n- uses: actions/setup-python@v6\n  with:\n    python-version: '3.12'\n- run: pip install griffe\n- uses: Alberto-Codes/docvet@v1\n```\n\n## AI Agent Integration\n\nFor tool-specific integration snippets, see the [full AI Agent Integration guide](https://alberto-codes.github.io/docvet/ai-integration/).\n\nAdd docvet to your AI coding workflow. Drop this into your `CLAUDE.md`, `.cursorrules`, or agent configuration:\n\n```markdown\n## Docstring Quality\n\nAfter modifying Python functions, classes, or modules, run `docvet check` and fix all findings before committing.\n```\n\nRecommended `pyproject.toml` configuration:\n\n```toml\n[tool.docvet]\nfail-on = [\"enrichment\", \"freshness\", \"coverage\", \"griffe\"]\n```\n\n### Subcommand Quick Reference\n\n| Command | Description |\n|---------|-------------|\n| `docvet check` | Run all enabled checks (default: git diff files) |\n| `docvet check --all` | Run all checks on entire codebase |\n| `docvet check --staged` | Run all checks on staged files only |\n| `docvet presence` | Check for missing docstrings with coverage metrics |\n| `docvet enrichment` | Check for missing docstring sections |\n| `docvet freshness` | Detect stale docstrings via git |\n| `docvet freshness --mode drift` | Sweep for long-stale docstrings via git blame |\n| `docvet coverage` | Find files invisible to mkdocs |\n| `docvet griffe` | Check mkdocs rendering compatibility |\n| `docvet fix` | Scaffold missing docstring sections |\n| `docvet fix --dry-run` | Preview scaffolding changes without writing files |\n| `docvet config` | Show effective configuration with source annotations |\n| `docvet lsp` | Start LSP server for real-time editor diagnostics |\n| `docvet mcp` | Start MCP server for AI agent integration |\n\n## Better Docstrings, Better AI\n\nAI coding agents rely on docstrings as context when generating and modifying code. Agents modify code but often leave docstrings stale, and research shows stale or incorrect documentation is actively harmful, worse than no docs at all:\n\n- Incorrect docs [degrade LLM task success by 22.6 percentage points](https://arxiv.org/abs/2404.03114)\n- Comment density [improves code generation by 40-54%](https://arxiv.org/abs/2402.13013)\n- Misleading comments [reduce LLM fault localization accuracy to 24.55%](https://arxiv.org/abs/2504.04372)\n- Performance [drops substantially without docstrings](https://arxiv.org/abs/2508.09537)\n\nAs the [2025 DORA report](https://cloud.google.com/resources/content/2025-dora-ai-assisted-software-development-report) puts it: \"AI doesn't fix a team; it amplifies what's already there.\" The [only signal correlating with AI productivity is code quality](https://stackoverflow.blog/2026/02/04/code-smells-for-ai-agents-q-and-a-with-eno-reyes-of-factory).\n\ndocvet's freshness checking catches the accuracy gap that stale docs create, and its enrichment rules ensure the docstring sections that agents use as context are complete. Run `docvet check` in your CI, pre-commit hooks, or agent toolchain.\n\n## Badge\n\nAdd a badge to your project to show your docs are vetted:\n\n```markdown\n[![docs vetted | docvet](https://img.shields.io/badge/docs%20vetted-docvet-purple)](https://github.com/Alberto-Codes/docvet)\n```\n\n## Used By\n\nAre you using docvet? Open a pull request to add your project here.\n\n## License\n\nMIT -- see [LICENSE](https://github.com/Alberto-Codes/docvet/blob/main/LICENSE) for details.\n\nmcp-name: io.github.Alberto-Codes/docvet\n",
  "bytes": 8593,
  "sha": "5b7a988038be8dcca9237a3b83ee46c792b12a96bca0f5117c6026564b930d57",
  "repo_slug": "alberto-codes/docvet",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_alberto_codes_docvet_411ec3da/readme"
}