{"id":13989645,"url":"https://github.com/ewolfe/prlint","last_synced_at":"2025-07-22T11:31:07.866Z","repository":{"id":66149196,"uuid":"112118860","full_name":"ewolfe/prlint","owner":"ewolfe","description":"GitHub App for linting pull request meta data","archived":false,"fork":false,"pushed_at":"2020-03-30T14:06:39.000Z","size":3523,"stargazers_count":126,"open_issues_count":38,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-09T13:16:17.366Z","etag":null,"topics":["continuous-integration","github-app","linter","pull-requests"],"latest_commit_sha":null,"homepage":"https://github.com/apps/prlint","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewolfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-26T21:40:42.000Z","updated_at":"2024-02-08T19:47:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"27cf31f9-5133-4b21-8752-bd2a3599db3e","html_url":"https://github.com/ewolfe/prlint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewolfe%2Fprlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewolfe%2Fprlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewolfe%2Fprlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewolfe%2Fprlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewolfe","download_url":"https://codeload.github.com/ewolfe/prlint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227079527,"owners_count":17728028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-integration","github-app","linter","pull-requests"],"created_at":"2024-08-09T13:01:53.696Z","updated_at":"2024-11-29T08:31:58.575Z","avatar_url":"https://github.com/ewolfe.png","language":"JavaScript","readme":"\n# PRLint\n\n\u003e GitHub App for linting pull requests\n\n[![Uptime Robot status](https://img.shields.io/uptimerobot/status/m779695827-b37294d12c5f3ad174528d33.svg)](https://stats.uptimerobot.com/ZzYnEf2BW)\n[![Greenkeeper badge](https://badges.greenkeeper.io/ewolfe/prlint.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/ewolfe/prlint.svg?branch=master)](https://travis-ci.org/ewolfe/prlint)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/fb62a8bd830f8ae59327/test_coverage)](https://codeclimate.com/github/ewolfe/prlint)\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/prlint)\n\n\n## The Problem\n\nYou want your pull requests to have a consistent convention for titles, descriptions, branch names, labels, milestones, and more.\n\n## This Solution\n\nPRLint will let you run regular expressions against your pull request meta data. You can then enable PRLint status checks to pass before a pull request can be merged.\n\n## Screenshots\n\n[![Success](https://cdn.rawgit.com/ewolfe/prlint/master/assets/screenshot-success.png)](https://cdn.rawgit.com/ewolfe/prlint/master/assets/screenshot-success.png)\n\n[![Error](https://cdn.rawgit.com/ewolfe/prlint/master/assets/screenshot-error.png)](https://cdn.rawgit.com/ewolfe/prlint/master/assets/screenshot-error.png)\n\n## Example Rules\n\n`.github/prlint.json`\n\n```javascript\n{\n  \"title\": [\n    {\n      \"pattern\": \"^(build|ci|docs|feat|fix|perf|refactor|style|test):\\\\s\",\n      \"message\": \"Your title needs to be prefixed with a topic\"\n    }\n  ],\n  \"body\": [\n    {\n      \"pattern\": \"JIRA-\\\\d{1,4}\",\n      \"flags\": [\"i\"],\n      \"message\": \"You need a JIRA ticket in your description\"\n    },\n    {\n      \"pattern\": \".{1,}\",\n      \"message\": \"You need literally anything in your description\"\n    }\n  ],\n  \"head.ref\": [\n    {\n      \"pattern\": \"^(build|ci|docs|feat|fix|perf|refactor|style|test)/\",\n      \"message\": \"Your branch name is invalid\"\n    }\n  ],\n  \"assignee.login\": [\n    {\n      \"pattern\": \".+\",\n      \"message\": \"You need to assign someone\"\n    }\n  ],\n  \"requested_teams.0.id\": [\n    {\n      \"pattern\": \"2691982\",\n      \"message\": \"The product team needs to be added as a reviewer\"\n    }\n  ],\n  \"additions\": [\n    {\n      \"pattern\": \"0|^[1-9]$|^[1-9]\\\\d$\",\n      \"message\": \"Your PR is too big (over 99 additions)\"\n    }\n  ],\n  \"labels.0.name\": [\n    {\n      \"pattern\": \"bug|enhancement|question\",\n      \"message\": \"Please add a label\"\n    }\n  ]\n}\n```\n\nYou can check anything listed in the [pull request object](https://developer.github.com/v3/pulls/#get-a-single-pull-request)\n\n## Install\n\n1.  Install via https://github.com/apps/prlint\n1.  Add this file `.github/prlint.json` to the root of your project:\n\n```javascript\n{\n  \"title\": [\n    {\n      \"pattern\": \"^(build|ci|docs|feat|fix|perf|refactor|style|test)((.+))?:\\\\s.+\",\n      \"message\": \"Your title needs to be prefixed with a topic\"\n    }\n  ]\n}\n```\n\n3.  Test it by opening a pull request with the title \"chore: add prlint\"\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.rawgit.com/ewolfe/prlint/master/assets/demo.gif\" alt=\"Demo\"\u003e\n\u003c/p\u003e\n\n## Usage\n\n### Keys:\n\nThe top level keys are keys that the GitHub API exposes when a pull request is opened, edited, etc.\n\nYou can use anything listed in the sample response object here\n[sample response object here](https://developer.github.com/v3/pulls/#get-a-single-pull-request)\n\nTo target a nested object, you can use dot notation encoded within the key string. i.e.:\n\n```javascript\n{\n  \"assignee.login\": [\n    {\n      \"pattern\": \"octocat\"\n    }\n  ]\n}\n```\n\n### Values:\n\nThe top level values are where you get to define your validation rules. You can have multiples rules, so we expect an array (even if you only have a single validation rule).\n\n* Each item in the array needs to be an object:\n* `pattern:` javascript [Regular Expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Syntax)\n  * _Special characters must be escaped_\n    i.e. If you want to check for a whitespace, use `\"pattern\": \"\\\\s\"` vs `\"pattern\": \"\\s\"`\n* `flags:` optional array of strings used in the [Regular Expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)\n  * For example, this can be used to make your regex case insensitive\n* `message`: optional string for customizing the error message on the pull request page\n\n## Credits\n\n* [“Dust Bunny”](https://thenounproject.com/term/lint/176538/) icon by Erika Kim from [the Noun Project](https://thenounproject.com/).\n\n## License\n\nMIT\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/781818?v=4\" width=\"100px;\" alt=\"Hrusikesh Panda\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHrusikesh Panda\u003c/b\u003e\u003c/sub\u003e](http://about.me/hkpanda)\u003cbr /\u003e[🚇](#infra-mrchief \"Infrastructure (Hosting, Build-Tools, etc)\") [⚠️](https://github.com/ewolfe/prlint/commits?author=mrchief \"Tests\") [💻](https://github.com/ewolfe/prlint/commits?author=mrchief \"Code\") |\n| :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewolfe%2Fprlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewolfe%2Fprlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewolfe%2Fprlint/lists"}