tmccarthy / github-pr-language-detection   0.0.2

Apache License 2.0 GitHub

Tool that uses github-linguist to detect the language on every PR raised against a repository

Scala versions: 2.13

github-pr-language-detection

CircleCI Maven Central

A utility for detecting the programming languages used in pull requests against a GitHub repository.

Requires that github-linguist is installed and available on the PATH (see instructions).

Usage

Running on the command line

The project is configured using a json file of the following format:

{
  "gitHubConfiguration": {
    "credentials": {
      "username": "[email protected]",
      "personalAccessToken": "<personal access token>"
    },
    "instance": "github.com"
  },
  "repositoryToScan": "tmccarthy/github-pr-language-detection",
  "performance": {
    "checkoutsPerMinute": 16,
    "maxConcurrent": 2,
    "checkoutTimeout": "PT10S",
    "languageCheckTimeout": "PT30S"
  },
  "reportConfig": {
    "output": "output.csv",
    "timeZone": "Australia/Melbourne",
    "languagesToIgnoreIfPossible": [
      "Shell"
    ]
  }
}

Provide the path to the config file to the cli/run SBT task:

./sbt "cli/run runconfig.json"

Use as a library

Add the following to your build.sbt file:

libraryDependencies += "au.id.tmm.github-pr-language-detection" %% "github-pr-language-detection-lib" % "0.0.2"