/checkpatch-action

Github action for checkpatch.pl

Primary LanguageShell

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.

Screenshots

Result of checkpatch

check

Code annotations

annotations

You can also check the comments directly in the console log.

console log

Action setup guide

Pull Request

.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

For using a custom checkpatch script, pass the CHECKPATCH_COMMAND environment variable. For example, for DPDK's checkpatches.sh script use:

name: checkpatch review
on: [pull_request]
jobs:
  my_review:
    name: checkpatch review
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Run DPDK checkpatches.sh review
      uses: webispy/checkpatch-action@master
      env:
        DPDK_CHECKPATCH_PATH: /usr/bin/checkpatch.pl
        CHECKPATCH_COMMAND: ./devtools/checkpatches.sh

References

checkpatch tool

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

Docker image

You can find the Dockerfile from docker branch of this repository.

License

The checkpatch.pl file is a script in the Linux kernel source tree, so checkpatch-action projects and forked projects must comply with the GPL-2.0 license (kernel license).