From 441b2b2f4ef15194cd23788179a959626d3b62f4 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Mon, 27 Apr 2026 14:07:47 +0800 Subject: [PATCH 1/2] workflows: Enable style checking for new PRs Add checkpatch review workflow yml and the config file for the script. Signed-off-by: Hao Yao --- .checkpatch.conf | 5 +++++ .github/workflows/checkpatch-pr.yml | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .checkpatch.conf create mode 100644 .github/workflows/checkpatch-pr.yml 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..79ef8ad --- /dev/null +++ b/.github/workflows/checkpatch-pr.yml @@ -0,0 +1,17 @@ +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: Run checkpatch review + uses: webispy/checkpatch-action@v9 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file From 506c491a96709baedf8ae9f92160954078f9b4dd Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Tue, 19 May 2026 16:53:55 +0800 Subject: [PATCH 2/2] workflows: Use latest checkpatch.pl every run Signed-off-by: Hao Yao --- .github/workflows/checkpatch-pr.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkpatch-pr.yml b/.github/workflows/checkpatch-pr.yml index 79ef8ad..a7e334c 100644 --- a/.github/workflows/checkpatch-pr.yml +++ b/.github/workflows/checkpatch-pr.yml @@ -11,7 +11,15 @@ jobs: 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}} \ No newline at end of file + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + CHECKPATCH_COMMAND: ./checkpatch.pl --no-tree \ No newline at end of file