Skip to content

Kyash/ghlint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c8eefd3 · Apr 28, 2021
Apr 28, 2021
Apr 28, 2021
Apr 28, 2021
Apr 28, 2021
Apr 28, 2021
Mar 12, 2021
Mar 12, 2021
Apr 28, 2021
Apr 9, 2021
Apr 28, 2021
Apr 28, 2021

Repository files navigation

ghlint

Docker

Find problems in your GitHub settings.

Installation

git clone git@github.com:Kyash/ghlint.git
cd ghlint
install -m 755 ./bin/ghlint /usr/local/bin

Prerequisites

  • Docker

Usage

Displayed by executing the following command:

ghlint -h

Example

ghlint orgs/Kyash > results.tsv

Exit status

  • 0: There was no rule violation
  • 1: One or more rule violations found
  • other: An unexpected error has occurred

Configure rules

Describe the rule settings in .ghlintrc.json.

  • For example, describe rules::repo::manage_team_access settings in .rules.repo.manage_team_access.patterns element
  • Multiple settings can be described in patterns element
  • Use filter element to specify targets
    • To exclude all targets from the rule, describe the pattern element as follows: { "filter": { "name": "^$" } }
  • Other rule-specific settings can also be described.

Example

If Kyash organization expects all repositories to have write permission from engineer team, then describe:

{
  "rules": {
    "repo": {
      "manage_team_access": {
        "patterns": [
          {
            "filter": {
              "full_name": "^Kyash/"
            },
            "allowlist": [
              {
                "slug": "engineer",
                "permission": "push",
                "strict": true
              }
            ]
          }
        ]
      }
    }
  }
}

Development

Getting Started

Launch the development environment

bash -i ./launch_dev_env.sh

Testing

Use Bats-core to run the test.

bats -r test

Dependencies

  • GitHub REST API
  • cURL v7.75.0+
  • Bash v5.0+
  • Node.js v10.24.0+
  • jq v1.6+

Further reading

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Kyash/ghlint