Command line tool for codeowners that helps identify the owners for files in a local repository or directory as well as identifying unowned code owners.
Made with contrib.rocks.
Key Features • Getting started • How to use • Configuration • Related projects • License • Code Quality •
Once you have built and released the application, you can use the following commands to deploy the application to your Mac, Linux or Windows machine.
brew tap vincentjames501/tap
brew install codeowners-cli
To upgrade version
brew update
brew upgrade codeowners-cli
Invoking the command displays the usage information as shown below.
$ codeowners-cli help
Usage: codeowners-cli [-hV] [COMMAND]
Process CODEOWNER files
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
help Display help information about the specified command.
list Lists all files with the corresponding approvers.
verify Verifies the format of the CODEOWNERS file.
$ codeowners-cli list help
Usage: codeowners-cli list [-fguv] [-c=<codeownersFile>] [-p=<basePath>]
[-o=<owners>]... <files>... [COMMAND]
Lists all files with the corresponding approvers.
<files>... Specifies the files to scan.
Default: ./
-c, --codeowners-file=<codeownersFile>
Specify the path to the CODEOWNERS file.
-f, --fail-on-matches Whether to exit non-zero if there are any matches.
-g, --git Indicates whether git should be used to find .
gitignore files. (git must be available on command
line).
-o, --owners=<owners> Filters the results by owner.
-p, --base-path=<basePath>
The projects base path (useful for when .gitignore is
located elsewhere).
-u, --unowned-files Whether to only show unowned files (can be combined
with -o).
-v, --verbose Use verbose output
Commands:
help Display help information about the specified command.
$ codeowners-cli list
File | Approvers
./CODE_OF_CONDUCT.md | @default-team
./CONTRIBUTING.md | @default-team
./LICENSE | @default-team
./README.md | @default-team
./dependency-reduced-pom.xml | @default-team
./etc/eclipse-formatter-config.xml | @default-team
./etc/license.txt | @default-team
./jreleaser.yml | @default-team
./mvnw | @default-team
./mvnw.cmd | @default-team
./pom.xml | @default-team
./src/main/assembly/assembly.xml | @devs, @default-team
./src/main/java/org/vincentjames501/codeowners/CodeOwnersCLI.java | @devs, @default-team
./src/main/java/org/vincentjames501/codeowners/commands/ListCodeOwners.java | @devs, @default-team
./src/main/java/org/vincentjames501/codeowners/commands/Verify.java | @devs, @default-team
./src/main/resources/META-INF/native-image/native-image.properties | @devs, @default-team
./src/main/resources/META-INF/native-image/reflect-config.json | @devs, @default-team
./src/test/java/org/vincentjames501/codeowners/CodeOwnersCLITest.java | @testers, @default-team
./src/test/resources/CODEOWNERS | @testers, @default-team
codeowners-cli verify help
Usage: codeowners-cli verify [-v] [-c=<codeownersFile>] [COMMAND]
Verifies the format of the CODEOWNERS file.
-c, --codeowners-file=<codeownersFile>
Specify the path to the CODEOWNERS file.
Default: ./CODEOWNERS
-v, --verbose Use verbose output
Commands:
help Display help information about the specified command.
$ codeowners-cli verify
CODEOWNERS file is valid.
To use with Pre-commit, simply add the following to your .pre-commit-config.yaml
:
- repo: https://github.com/vincentjames501/codeowners-cli
rev: v0.0.9
hooks:
- id: codeowners-cli
args: [ "list", "--unowned-files", "--fail-on-matches" ]
- repo: https://github.com/vincentjames501/codeowners-cli
rev: v0.0.9
hooks:
- id: codeowners-cli
args: [ "verify" ]
This package is also published to Maven for more advanced use cases:
<dependency>
<groupId>io.github.vincentjames501</groupId>
<artifactId>codeowners-cli</artifactId>
<version>0.0.9</version>
</dependency>
This is powered by GraalVM native image and distribution using JReleaser and GitHub Actions and Workflow.
rrajesh1979/ref-java-jwt
– Build process heavily inspired by https://github.com/rrajesh1979/ref-java-jwtnielsbasjes/codeowners
– Leverages parsers for the CLI https://github.com/nielsbasjes/codeowners