diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 0000000..c10c33f --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,5 @@ +--no-tree +--ignore FILE_PATH_CHANGES +--exclude kernel_patches +--exclude patch +--exclude .github diff --git a/.github/workflows/checkpatch-pr.yml b/.github/workflows/checkpatch-pr.yml new file mode 100644 index 0000000..a7e334c --- /dev/null +++ b/.github/workflows/checkpatch-pr.yml @@ -0,0 +1,25 @@ +name: checkpatch review +on: [pull_request] +jobs: + my_review: + name: checkpatch review + runs-on: ubuntu-latest + steps: + - name: 'Calculate PR commits + 1' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + - name: Download latest checkpatch.pl from kernel tree + run: | + curl -sSL https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl \ + -o $GITHUB_WORKSPACE/checkpatch.pl + curl -sSL https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt \ + -o $GITHUB_WORKSPACE/spelling.txt + chmod +x $GITHUB_WORKSPACE/checkpatch.pl + - name: Run checkpatch review + uses: webispy/checkpatch-action@v9 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + CHECKPATCH_COMMAND: ./checkpatch.pl --no-tree \ No newline at end of file