Skip to content

markokajzer/code-review-leaderboard

Repository files navigation

Code Review Leaderboard

Create a leaderboard of code reviewers for your repository or organization.

Find out who is the most active reviewer in your team, who is the most thorough, and who is the most critical.

Examples

Screenshot 2024-02-10 at 21 08 05

Reviews are counted by the following rules:

  1. Completed within the last 30 days
  2. Multiple comments only count once.
  3. If a reviewer both approves/rejects a pull request and comments, the comments do not count extra.
  4. Approvals and rejections always count.

For a repository of 718 repositories and 526 reviews, the script takes roughly 1 minute.

Installation

Install the gem:

$ gem install code_review_leaderboard

Usage

To use the gem, you will need to provide a GitHub access token. You can create a new access token by following the instructions here. If you want to inspect the repositories of an organization, make sure the organization in question allows access to their repositories from personal access tokens. You can check that from https://github.com/organizations/<name>/settings/personal-access-tokens.

To inspect the reviews of a single repository, run:

$ code_review_leaderboard --access_token ACCESS_TOKEN --repository REPOSITORY

You can also provide multiple repositories:

$ code_review_leaderboard --access_token ACCESS_TOKEN --repository REPOSITORY1 REPOSITORY2

Finally, you can also inspect the repositories of an organization:

$ code_review_leaderboard --access_token ACCESS_TOKEN --organization ORGANIZATION

Configuration

You can either configure the gem via command line arguments or by setting environment variables. Command line arguments take precedence.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. You can then run it with bundle exec <executable>. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/markokajzer/code-review-leaderboard.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published