0.07
No release in over 3 years
Low commit activity in last 3 years
utility gem for .github/CODEOWNERS introspection
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

Utility gem for .github/CODEOWNERS introspection

GitHub's CODEOWNERS rules are allegedly based on the gitignore format with a few small exceptions.

Install

gem install code_owners

Requirements

  • Ruby
  • Git

Usage

your/repo/path$ code_owners --help
usage: code_owners [options]
    -u, --unowned         Display unowned files only
    -e, --error-unowned   Exit with error status if any files are unowned
    -i, --ignore FILE     A file of gitignore patterns to filter out of results, may be specified multiple times, only supported by -n option for now
    -l, --log             Log stuff
    -n, --no-git          [experimental] Use a git-free, pure ruby based implementation
    -v, --version         Display the version of the gem

Several of those get transformed into option flags that get passed along to CodeOwners.ownerships, see bin/codeowners

Output

vendor/cache/cloudfiles-1.4.16.gem                                                                   UNOWNED
vendor/cache/code_owners-1.0.1.gem                                                                   jcheatham per line 213, vendor/*/code_owners*
vendor/cache/coderay-1.1.0.gem                                                                       UNOWNED

Development

Maybe put it in a cleanliness test, like:

it "does not introduce new unowned files" do
  unowned_files = CodeOwners.ownerships.select { |f| f[:owner] == CodeOwners::NO_OWNER }
  # this number should only decrease, never increase!
  assert_equal 12345, unowned_files.count, "Claim ownership of your new files in .github/CODEOWNERS to fix this test!"
end

Author

Jonathan Cheatham
coaxis@gmail.com
License: MIT