From d0c459d9fb1901ab4c5dc67ff3ec94bac4d7b848 Mon Sep 17 00:00:00 2001 From: Kamil Gierszewski Date: Mon, 9 Sep 2024 15:09:40 +0200 Subject: [PATCH] github-actions: add checkpatch Signed-off-by: Kamil Gierszewski --- .checkpatch.conf | 12 ++++++++++++ .github/workflows/checkpatch.yml | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .checkpatch.conf create mode 100644 .github/workflows/checkpatch.yml diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 000000000..70ee76e9e --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,12 @@ +--max-line-length=80 +--no-tree + +--ignore AVOID_BUG +--ignore COMMIT_MESSAGE +--ignore FILE_PATH_CHANGES +--ignore PREFER_PR_LEVEL +--ignore SPDX_LICENSE_TAG +--ignore SPLIT_STRING + +--exclude test +--exclude ocf diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 000000000..2047c77fa --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,15 @@ +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