A git subcommand to query and validate CODEOWNERS
Project description
git-codeowners
A git subcommand to query and validate CODEOWNERS.
List owners of files based on the CODEOWNERS of the current repository.
> git codeowners src/main.rs
src/main.rs @weyland
> git codeowners `git ls-files`
.gitignore (unowned)
Cargo.lock @weyland
Cargo.toml @weyland
LICENSE (unowned)
README.md @weyland
src/main.rs @weyland
# oops, did the last commit add some unowned files?
> git diff --name-only --diff-filter=A | git codeowners
.gitignore (unowned)
LICENSE (unowned)
# I need stats about my big monorepo
> echo `git ls-files | git codeowners | grep "(unowned)"| wc -l` out of `git ls-files | git codeowners | wc -l` files in this repository do not have a corresponding CODEOWNERS entry
2 out of 6 files in this repository do not have a corresponding CODEOWNERS entry
Installation
- Via pip:
pip install git-codeowners
- Via Cargo:
cargo install git-owners
Usage
-
Get owners of a file
git codeowners some/file
-
Get owners for a list of files
git codeowners some/file some/other/file
-
Get owners for every tracked file
git ls-files | git codeowners
-
Get owners for files modified in last five commits
git diff --name-only HEAD~5 HEAD | git codeowners
-
Congratulate the user if the current changeset does not add files without owner
git diff --diff-filter=ACR --name-only | git codeowners && echo "Great job! No unowned files added!"
-
Get an overview of your CODEOWNERS coverage
echo `git ls-files | git codeowners | grep "(unowned)"| wc -l` out of `git ls-files | git codeowners | wc -l` files in this repository do not have a corresponding CODEOWNERS entry
Features
- Detects the right CODEOWNERS file of the current git repository
- Is composable & scripting friendly
- Works well as a pre-commit hook
- Is fast & written in Rust
Issues & Contributing
If you have any questions or problems, feel free to communicate using Github Issues.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for git_codeowners-1.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 099d0d954758b7f9281e50521940d73ca87b0efa138e3fac7d035d82036b11fe |
|
MD5 | d676e7ea849229b9d807a2da94ee86d7 |
|
BLAKE2b-256 | cfedf27f9ff6f2e9e89d9fef2f487aa843c8da794e53b13a25d8c48565cbd2e5 |
Close
Hashes for git_codeowners-1.0.3-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5feaf409497d625b1ddc8c34f5b055241bfb103997f7827c94353675d8e8762 |
|
MD5 | 4035ae9eb0799c6d26e6c006829bc1de |
|
BLAKE2b-256 | 8984fad7307fd27d8a15b91959fd200a92c4b4841da259c7638643ac8a2777ed |
Close
Hashes for git_codeowners-1.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f45d32b4a5248d78e307e42849db32ecc193c488a0ce58de0f371062610300b2 |
|
MD5 | ade006be5bbafdc7d55c1098a68c2731 |
|
BLAKE2b-256 | 3af15a6e6ae41f99f2b223477806c1988627fe279f1ea83784987b96ffe369a0 |