Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

checkpatch.pl PR review

v4

checkpatch.pl PR review

check-square

checkpatch.pl PR review

Code review for PR using checkpatch.pl

Installation

Copy and paste the following snippet into your .yml file.

              

- name: checkpatch.pl PR review

uses: webispy/checkpatch-action@v4

Learn more about this action in webispy/checkpatch-action

Choose a version

Github action for checkpatch.pl

The checkpatch.pl is a perl script to verify that your code conforms to the Linux kernel coding style. This project uses checkpatch.pl to automatically review and leave comments on pull requests.

Resources

Following files are used to this project.

Patch

add option for excluding directories

From zephyr project:

Disable warning for "No structs that should be const ..."

Action setup guide

Pull Request from owned repository

.github/workflows/main.yml

name: checkpatch review
on: [pull_request]
jobs:
  my_review:
    name: checkpatch review
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Run checkpatch review
      uses: webispy/checkpatch-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The checkpatch action will posting comments for error/warning result to the PR conversation.

Pull Request from forked repository

The Github action has a limitation that doesn't have write permission for PR from forked repository. So the action cannot write a comment to the PR.

.github/workflows/main.yml

name: checkpatch review
on: [pull_request]
jobs:
  my_review:
    name: checkpatch review
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Run checkpatch review
      uses: webispy/checkpatch-action@master

You can find the error/waring result from Github action console log.

License

Since the checkpatch.pl file is a script in the Linux kernel source tree, you must follow the GPL-2.0 license, which is your kernel license.