All Projects → ewolfe → prlint

ewolfe / prlint

Licence: MIT license
GitHub App for linting pull request meta data

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to prlint

linter-alex
📝Sensitive, considerate writing before you merge your Pull Requests
Stars: ✭ 67 (-45.08%)
Mutual labels:  continuous-integration, linter, github-app
arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (-48.36%)
Mutual labels:  continuous-integration, linter
branch-name-lint
Lint your branch names
Stars: ✭ 60 (-50.82%)
Mutual labels:  continuous-integration, linter
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-69.67%)
Mutual labels:  continuous-integration, linter
Clippy Check
📎 GitHub Action for PR annotations with clippy warnings
Stars: ✭ 159 (+30.33%)
Mutual labels:  linter, pull-requests
tagref
Tagref helps you maintain cross-references in your code.
Stars: ✭ 92 (-24.59%)
Mutual labels:  continuous-integration, linter
Format.cmake
💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.
Stars: ✭ 94 (-22.95%)
Mutual labels:  continuous-integration, linter
pull-request-size
Applies labels to Pull Requests based on the total lines of code changed.
Stars: ✭ 98 (-19.67%)
Mutual labels:  pull-requests, github-app
Gopherci
GopherCI was a project to help you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other third party static analysis tools.
Stars: ✭ 105 (-13.93%)
Mutual labels:  continuous-integration, linter
scalafmt-probot
🤖Github bot for checking code formatting with scalafmt
Stars: ✭ 15 (-87.7%)
Mutual labels:  pull-requests, github-app
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-5.74%)
Mutual labels:  continuous-integration, linter
Pep8speaks
A GitHub app to automatically review Python code style over Pull Requests
Stars: ✭ 546 (+347.54%)
Mutual labels:  linter, github-app
typo3-typoscript-lint
Find coding errors in your TypoScript files.
Stars: ✭ 78 (-36.07%)
Mutual labels:  continuous-integration, linter
makefiles
No description or website provided.
Stars: ✭ 23 (-81.15%)
Mutual labels:  continuous-integration, linter
Probot Gpg
A GitHub App that enforces GPG signatures on pull requests (no longer maintained)
Stars: ✭ 13 (-89.34%)
Mutual labels:  pull-requests, github-app
arduino-lint-action
GitHub Actions action to check Arduino projects for problems
Stars: ✭ 20 (-83.61%)
Mutual labels:  continuous-integration, linter
branch-switcher
a GitHub bot that switches the base branch of pull requests to the preferred branch
Stars: ✭ 15 (-87.7%)
Mutual labels:  pull-requests, github-app
Changelog Ci
Changelog CI is a GitHub Action that generates changelog, Then the changelog is committed and/or commented to the release Pull request.
Stars: ✭ 68 (-44.26%)
Mutual labels:  continuous-integration, pull-requests
Bundlewatch
Keep watch of your bundle size
Stars: ✭ 241 (+97.54%)
Mutual labels:  continuous-integration, pull-requests
yamburger
YAML syntax got you down? That's a YAMBURGER!
Stars: ✭ 32 (-73.77%)
Mutual labels:  linter, github-app

PRLint

GitHub App for linting pull requests

Uptime Robot status Greenkeeper badge Build Status Test Coverage All Contributors Join the community on Spectrum

The Problem

You want your pull requests to have a consistent convention for titles, descriptions, branch names, labels, milestones, and more.

This Solution

PRLint 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.

Screenshots

Success

Error

Example Rules

.github/prlint.json

{
  "title": [
    {
      "pattern": "^(build|ci|docs|feat|fix|perf|refactor|style|test):\\s",
      "message": "Your title needs to be prefixed with a topic"
    }
  ],
  "body": [
    {
      "pattern": "JIRA-\\d{1,4}",
      "flags": ["i"],
      "message": "You need a JIRA ticket in your description"
    },
    {
      "pattern": ".{1,}",
      "message": "You need literally anything in your description"
    }
  ],
  "head.ref": [
    {
      "pattern": "^(build|ci|docs|feat|fix|perf|refactor|style|test)/",
      "message": "Your branch name is invalid"
    }
  ],
  "assignee.login": [
    {
      "pattern": ".+",
      "message": "You need to assign someone"
    }
  ],
  "requested_teams.0.id": [
    {
      "pattern": "2691982",
      "message": "The product team needs to be added as a reviewer"
    }
  ],
  "additions": [
    {
      "pattern": "0|^[1-9]$|^[1-9]\\d$",
      "message": "Your PR is too big (over 99 additions)"
    }
  ],
  "labels.0.name": [
    {
      "pattern": "bug|enhancement|question",
      "message": "Please add a label"
    }
  ]
}

You can check anything listed in the pull request object

Install

  1. Install via https://github.com/apps/prlint
  2. Add this file .github/prlint.json to the root of your project:
{
  "title": [
    {
      "pattern": "^(build|ci|docs|feat|fix|perf|refactor|style|test)((.+))?:\\s.+",
      "message": "Your title needs to be prefixed with a topic"
    }
  ]
}
  1. Test it by opening a pull request with the title "chore: add prlint"

Demo

Usage

Keys:

The top level keys are keys that the GitHub API exposes when a pull request is opened, edited, etc.

You can use anything listed in the sample response object here sample response object here

To target a nested object, you can use dot notation encoded within the key string. i.e.:

{
  "assignee.login": [
    {
      "pattern": "octocat"
    }
  ]
}

Values:

The 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).

  • Each item in the array needs to be an object:
  • pattern: javascript Regular Expression
    • Special characters must be escaped i.e. If you want to check for a whitespace, use "pattern": "\\s" vs "pattern": "\s"
  • flags: optional array of strings used in the Regular Expression
    • For example, this can be used to make your regex case insensitive
  • message: optional string for customizing the error message on the pull request page

Credits

License

MIT

Contributors

Thanks goes to these wonderful people (emoji key):

Hrusikesh Panda
Hrusikesh Panda

🚇 ⚠️ 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].