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.1.1.tar.gz (18.1 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.1.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for checkowners-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a2da1cfaf6fdaf971e7744dc7736db2c0323fd8f84e6ebf496fdc077a18385fd
MD5 cb1220edc6a88df6b6fe92b82327cb0d
BLAKE2b-256 7c69a29e51fba322f0cd319e66529e252c17394eb5f872040ed184cac7674791

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkowners-0.1.1.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.1.1-py3-none-any.whl.

File metadata

  • Download URL: checkowners-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1d2e084346e2356ef49739f51ec2c9706a5f8942d5142d67736e7949411182e
MD5 a696d509c1215ed051ee4b92d6951e5d
BLAKE2b-256 0dcadeab5a08b44bda96fa941bbaa524d8520a4d3c842cf641a940914c71ba78

See more details on using hashes here.

Provenance

The following attestation bundles were made for checkowners-0.1.1-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