# docsci.yml
# DocsCI configuration file — add to your repository root
# Full docs: https://snippetci.com/docs
# Get free API token: https://snippetci.com/signup

docs:
  # Paths to search for documentation files
  path: .
  include:
    - "docs/**/*.md"
    - "docs/**/*.mdx"
    - "docs/**/*.rst"
    - "README.md"
    - "*.md"
  exclude:
    - "node_modules/**"
    - ".git/**"
    - "docs/_build/**"
    - "**/_static/**"
    - "CHANGELOG.md"

snippets:
  # Languages to execute
  languages:
    - python
    - javascript
    - typescript
    - bash
    - curl
    - go

  # Execution timeout per snippet (seconds)
  timeout_seconds: 20

  # Skip patterns — snippets containing these strings are not executed
  skip_patterns:
    - "# doctest: +SKIP"
    - "# docsci-skip"
    - "YOUR_API_KEY"
    - "YOUR_TOKEN"
    - "example.com"         # remove if you want to test live examples

checks:
  # Execute and verify code snippets
  snippets: true

  # Detect API drift against OpenAPI spec (requires openapi_url in CI workflow)
  drift: true

  # Accessibility checks (axe-core rules on rendered doc components)
  accessibility: false   # enable if you render doc pages

  # Copy linting (passive voice, sensitive terms, reading level)
  copy_lint: false       # enable for content quality gates

# Security — scanned before execution (cannot be disabled)
security:
  # Secret patterns scanned in snippets (40+ built-in + custom below)
  extra_patterns:
    # - "my-custom-prefix-[A-Za-z0-9]{32}"

# Thresholds — CI fails if exceeded
thresholds:
  max_findings: 0         # fail on any finding (set higher to allow warnings)
  max_critical: 0         # always fail on critical findings
  max_drift_findings: 0   # fail on any drift

# Notifications (optional)
# notify:
#   slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
#   on: [failure]

# ─────────────────────────────────────────────────────────────────
# Usage in GitHub Actions:
#
#   - name: Run DocsCI
#     run: |
#       tar czf docs.tar.gz docs/ *.md
#       curl -sf -X POST https://snippetci.com/api/runs/queue \
#         -H "Authorization: Bearer ${{ secrets.DOCSCI_TOKEN }}" \
#         -F "docs_archive=@docs.tar.gz" \
#       | jq -e '.status == "passed"'
#
# Full template: https://snippetci.com/public/templates/docsci-github-actions.yml
# ─────────────────────────────────────────────────────────────────
