Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Subject: [Tarantool-patches] [PATCH 2/2] ci: enable checkpatch
Date: Tue, 11 Jul 2023 19:51:34 +0300	[thread overview]
Message-ID: <ff7bc25982cbcb0a305b97da320754a7c06cd44a.1689075854.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1689075854.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

Patch enables checkpatch [1] for checking patch on a pre-commit stage.
In Tarantool we use our own fork of checkpatch [2] with additional check
types. It's logical to use it in a LuaJIT development. We don't need
check tags in commit messages like NO_DOC, NO_CHANGELOG, NO_TEST and
others, so to be able to customize command-line options Github Action, provided
by checkpatch repository [3], was added to the repository.

See documentation for used checkpatch in [4].

1. https://docs.kernel.org/dev-tools/checkpatch.html
2. https://github.com/tarantool/checkpatch
3. https://github.com/tarantool/checkpatch/blob/master/.github/actions/checkpatch/action.yml
4. https://github.com/tarantool/checkpatch/blob/master/doc/checkpatch.rst
---
 .github/actions/checkpatch/action.yml | 17 +++++++++++++++++
 .github/workflows/lint.yml            | 14 ++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 .github/actions/checkpatch/action.yml

diff --git a/.github/actions/checkpatch/action.yml b/.github/actions/checkpatch/action.yml
new file mode 100644
index 00000000..df2e2a2b
--- /dev/null
+++ b/.github/actions/checkpatch/action.yml
@@ -0,0 +1,17 @@
+name: Checkpatch
+description: Check patches against LuaJIT development guidelines
+inputs:
+  revision-range:
+    description: Git revision range to check
+    required: true
+runs:
+  using: composite
+  steps:
+    - uses: actions/checkout@v3
+      with:
+        repository: tarantool/checkpatch
+        path: 'checkpatch'
+    - run: apt install -y codespell
+      shell: bash
+    - run: checkpatch/checkpatch.pl --codespell --color=always --show-types --git ${{ inputs.revision-range }} --codespellfile /usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt --ignore NO_CHANGELOG,NO_DOC,NO_TEST,COMMIT_LOG_LONG_LINE
+      shell: bash
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 71ceee9a..d28aa15b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -53,3 +53,17 @@ jobs:
       - name: test
         run: cmake --build . --target LuaJIT-luacheck
         working-directory: ${{ env.BUILDDIR }}
+
+  checkpatch:
+    runs-on: [self-hosted, lightweight, Linux, x86_64]
+
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+          # ref: ${{ github.event.pull_request.head.sha }}
+          submodules: recursive
+      - name: checkpatch
+        uses: ./.github/actions/checkpatch
+        with:
+          revision-range: HEAD~${{ github.event.pull_request.commits }}..HEAD
-- 
2.34.1


  parent reply	other threads:[~2023-07-11 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 16:51 [Tarantool-patches] [PATCH 0/2] Fix typos and " Sergey Bronnikov via Tarantool-patches
2023-07-11 16:51 ` [Tarantool-patches] [PATCH 1/2] test: fix typos Sergey Bronnikov via Tarantool-patches
2023-07-14 11:53   ` Sergey Kaplun via Tarantool-patches
2023-07-14 12:36     ` Sergey Bronnikov via Tarantool-patches
2023-07-11 16:51 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-07-14 12:45   ` [Tarantool-patches] [PATCH 2/2] ci: enable checkpatch Sergey Kaplun via Tarantool-patches
2023-07-17 13:22     ` Sergey Bronnikov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff7bc25982cbcb0a305b97da320754a7c06cd44a.1689075854.git.sergeyb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] ci: enable checkpatch' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox