Skip to main content

Infer and maintain CODEOWNERS from git history. Drift detection, CI-native JSON output, and GitHub Actions integration.

Project description

checkowners

CI PyPI License: MIT

Infer and maintain CODEOWNERS from git history. Drift detection, CI-native JSON output, and GitHub Actions integration.

Installation

pip install checkowners

Quick Start

# Infer ownership from git commit history
checkowners analyze

# Generate .github/CODEOWNERS from inference
checkowners generate

# Detect drift between inferred and current CODEOWNERS
checkowners drift

# Validate CODEOWNERS syntax
checkowners validate

All commands support --json for structured output.

Commands

Command Description
checkowners analyze Infer file ownership from git history
checkowners generate Write .github/CODEOWNERS from inferred ownership
checkowners print Print inferred owners to stdout
checkowners validate Validate existing CODEOWNERS syntax (no git access)
checkowners drift Compare inferred vs. current CODEOWNERS
checkowners notify POST webhook on drift events
checkowners sync Generate CODEOWNERS and commit the result

Configuration

Create .github/checkowners.yml in your repository:

analysis:
  lookback_days: 180        # How far back to analyze
  min_commits: 3            # Minimum commits to qualify as owner
  top_n_owners: 2           # Max owners per path

paths:
  exclude:
    - "*.lock"
    - "dist/**"
    - "vendor/**"

output:
  header: "# Generated by checkOwners. Do not edit manually."
  include_unowned: false    # Show paths with no inferred owner

drift:
  mode: commit              # commit | repo | both
  compare_to: auto

notifications:
  webhook_url: ""           # POST here on drift events
  include_unchanged: false

All fields are optional. Defaults are shown above.

Drift Detection Modes

  • commit: detect paths in the inferred map that are missing from CODEOWNERS
  • repo: detect CODEOWNERS entries that are stale or have changed owners
  • both: run both checks

GitHub Actions

- name: Check CODEOWNERS drift
  run: |
    pip install checkowners
    checkowners drift --json

Set drift.mode: both in your config and fail the step when drift_detected is true.

Development

hatch run test              # pytest with coverage
hatch run lint              # ruff check + mypy --strict
hatch run fmt               # ruff format

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkowners-0.2.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

checkowners-0.2.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file checkowners-0.2.0.tar.gz.

File metadata

  • Download URL: checkowners-0.2.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for checkowners-0.2.0.tar.gz
Algorithm Hash digest
SHA256 594121936ed055d7c7dc3f7a2b7772542910eeafbfeb69bd9dfd2fdbc7f49082
MD5 d226cbf58f1ec96fba89fedce3d2a05f
BLAKE2b-256 ff10a652f5f5bd5b9d82feeffed55da5cf8567a5e765c9c1fe222c834e1014b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkowners-0.2.0.tar.gz:

Publisher: publish.yml on smusali/checkowners

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file checkowners-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: checkowners-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for checkowners-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8de7edf6a58bd331e036330e0cdb06c711a4def33ed3e2bcbe9212a56c2c911c
MD5 bc74408cf09b9b6716dbb55fc5b7aefb
BLAKE2b-256 094bd580d7e19c2b5a5d9d7dff4d4ab284fabc347b55a2cbbd70963a1a360dc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkowners-0.2.0-py3-none-any.whl:

Publisher: publish.yml on smusali/checkowners

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page