GitHub Action
checkpatch.pl PR review
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.
.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.
The capture image above shows the comments on the lines of code and the comments on the commit message.
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
Due to the above limitations, you can check the comments directly in the console log.
Following files are used to this project.
- https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl
- https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt
From zephyr project:
You can find the Dockerfile from docker branch of this repository.
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.