From ff2bb5da088beb3dd9b42629cf57cd786ffa110a Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Tue, 31 Oct 2023 10:10:58 -0400 Subject: [PATCH] [Build, CI]: Add a GitHub Action to run the checkpatch.pl script Signed-off-by: Martin Belanger --- .checkpatch.conf | 16 ++++++++++++++++ .github/workflows/checkpatch.yml | 15 +++++++++++++++ 2 files changed, 31 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 00000000..f2b7efea --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,16 @@ +# This isn't actually a Linux kernel tree +--no-tree + +--ignore EMAIL_SUBJECT +--ignore FILE_PATH_CHANGES + +#--ignore CONFIG_DESCRIPTION +#--ignore GERRIT_CHANGE_ID +#--ignore GIT_COMMIT_ID +#--ignore NEW_TYPEDEFS +#--ignore SPDX_LICENSE_TAG +#--ignore SPACING +#--ignore CONST_STRUCT +#--ignore EMBEDDED_FUNCTION_NAME +#--exclude externals +#--exclude examples diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 00000000..8cf5e493 --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,15 @@ +name: checkpatch review +on: [pull_request] +jobs: + checkpatch: + 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@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + - name: Run checkpatch review + uses: webispy/checkpatch-action@v9