How to create a stage that check every commit style?

I’m working on linux kernel and hope to use gitlab ci to autotest every merge request.

linux kernel has a ./scripts/checkpatch.pl which can check whether a mailbox patch conform kernel’s style, e.g., ./scripts/checkpatch.pl 0001-something.patch.

I want to integerate this check into gitlab ci, but don’t know how to archive it.

What’s I expected:

Every time someone make a merge request with one or more commits, the ci can always use checkpatch.pl to check all these commits.