Infer and maintain CODEOWNERS from git history. Drift detection, CI-native JSON output, and GitHub Actions integration.
Project description
checkowners
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2ffd5daabc98060cec6175dbb93c33fe4c226ff42ded18b013add4bf2608fef
|
|
| MD5 |
59536bed15cdcdbd474c79560a35728f
|
|
| BLAKE2b-256 |
3ccfc700902cd29a6356c4620222b61f32b3b74e376255e2c4d92b4993a4879b
|
Provenance
The following attestation bundles were made for checkowners-0.1.0.tar.gz:
Publisher:
publish.yml on smusali/checkowners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
checkowners-0.1.0.tar.gz -
Subject digest:
c2ffd5daabc98060cec6175dbb93c33fe4c226ff42ded18b013add4bf2608fef - Sigstore transparency entry: 1635290763
- Sigstore integration time:
-
Permalink:
smusali/checkowners@b8ec780802741593b7fa36d308996edb336499d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/smusali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8ec780802741593b7fa36d308996edb336499d1 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eae9e29af6131868d54df8e57faad32e8ba8e0c24173fc442c7d37bfb11e53c
|
|
| MD5 |
2c8b1775573e44bbbcf2a9ea5dce1fe3
|
|
| BLAKE2b-256 |
70c3f1b38be8275ebce74f14baf94a7f04f792242a8d0aeb39a294ed9c336b69
|
Provenance
The following attestation bundles were made for checkowners-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on smusali/checkowners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
checkowners-0.1.0-py3-none-any.whl -
Subject digest:
5eae9e29af6131868d54df8e57faad32e8ba8e0c24173fc442c7d37bfb11e53c - Sigstore transparency entry: 1635290802
- Sigstore integration time:
-
Permalink:
smusali/checkowners@b8ec780802741593b7fa36d308996edb336499d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/smusali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8ec780802741593b7fa36d308996edb336499d1 -
Trigger Event:
release
-
Statement type: