Doc-Warden

0.7.3 · active · verified Thu Apr 16

Doc-Warden is an internal project developed by the Azure SDK Team (current version 0.7.3). It is primarily a command-line tool used in CI builds to enforce documentation standards, specifically for READMEs and Changelogs, across Azure SDK repositories. Its release cadence is irregular, driven by the needs and development cycle of the broader Azure SDK Tools project.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `ward` command-line tool to perform documentation scans. The tool checks for README and Changelog standards based on a `.docsettings.yml` configuration file. It's designed to be run within a CI/CD pipeline, often targeting the source directory of a repository.

# Assume you have cloned a repository that needs documentation checks
# and that a .docsettings.yml file is present at its root.
# For example, let's use a placeholder for $(Build.SourcesDirectory)
REPO_ROOT="/path/to/your/repo"

# Install Doc-Warden (if not already installed)
# pip install doc-warden

# Example 1: Scan for Readme and Changelog standards (default .docsettings.yml at root)
print(f"Running doc-warden scan on {REPO_ROOT}...")
# In a real CI environment, this would be executed directly
# import subprocess
# subprocess.run(['ward', 'scan', '-d', REPO_ROOT], check=True)
print("ward scan -d $REPO_ROOT")

# Example 2: Scan with a custom .docsettings.yml path
DOCSETTINGS_PATH="$REPO_ROOT/eng/.docsettings.yml"
print(f"Running doc-warden scan on {REPO_ROOT} with custom config {DOCSETTINGS_PATH}...")
# subprocess.run(['ward', 'scan', '-d', REPO_ROOT, '-c', DOCSETTINGS_PATH], check=True)
print(f"ward scan -d $REPO_ROOT -c {DOCSETTINGS_PATH}")

view raw JSON →