Skip to main content

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

Project description

checkowners

PyPI version 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.0.tar.gz (29.6 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.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: checkowners-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 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.0.tar.gz
Algorithm Hash digest
SHA256 c2ffd5daabc98060cec6175dbb93c33fe4c226ff42ded18b013add4bf2608fef
MD5 59536bed15cdcdbd474c79560a35728f
BLAKE2b-256 3ccfc700902cd29a6356c4620222b61f32b3b74e376255e2c4d92b4993a4879b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: checkowners-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5eae9e29af6131868d54df8e57faad32e8ba8e0c24173fc442c7d37bfb11e53c
MD5 2c8b1775573e44bbbcf2a9ea5dce1fe3
BLAKE2b-256 70c3f1b38be8275ebce74f14baf94a7f04f792242a8d0aeb39a294ed9c336b69

See more details on using hashes here.

Provenance

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