Skip to content

Commit 3ade5c3

Browse files
haggaiewebispy
authored andcommitted
Allow customizing the checkpatch command
Provide an example use-case with DPDK checkpatches.sh in README.md Signed-off-by: Haggai Eran <haggaie@nvidia.com>
1 parent fc771a7 commit 3ade5c3

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ jobs:
3535
uses: webispy/checkpatch-action@master
3636
```
3737
38+
For using a custom checkpatch script, pass the `CHECKPATCH_COMMAND` environment
39+
variable. For example, for DPDK's `checkpatches.sh` script use:
40+
41+
```yml
42+
name: checkpatch review
43+
on: [pull_request]
44+
jobs:
45+
my_review:
46+
name: checkpatch review
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v1
50+
- name: Run DPDK checkpatches.sh review
51+
uses: webispy/checkpatch-action@master
52+
env:
53+
DPDK_CHECKPATCH_PATH: /usr/bin/checkpatch.pl
54+
CHECKPATCH_COMMAND: ./devtools/checkpatches.sh
55+
```
56+
3857
## References
3958

4059
### checkpatch tool

review.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
# To debug the current script, please uncomment the following 'set -x' line
44
#set -x
55

6+
if [[ -z "$CHECKPATCH_COMMAND" ]] ; then
7+
CHECKPATCH_COMMAND="checkpatch.pl --no-tree"
8+
fi
9+
610
# Generate email style commit message
711
PATCH_FILE=$(git format-patch $1 -1)
8-
PATCHMAIL=$(checkpatch.pl --no-tree $PATCH_FILE)
12+
PATCHMAIL=$($CHECKPATCH_COMMAND $PATCH_FILE)
913

1014
# Internal state variables
1115
RESULT=0

0 commit comments

Comments
 (0)