Browse Source

Add the possibility to pass options for checkpatch

It can be handy for example to add --strict option which can detect more
coding issues, even if not mandated by TF-A coding rules.
To use it:
 CHECKPATCH_OPTS="--strict" make checkpatch

Change-Id: I707e4cc2d1250b21f18ff16169b5f1e5ab03a7ed
Signed-off-by: Yann Gautier <yann.gautier@st.com>
pull/1861/head
Yann Gautier 6 years ago
parent
commit
02a76d5ff2
  1. 9
      Makefile

9
Makefile

@ -841,13 +841,18 @@ checkcodebase: locate-checkpatch
checkpatch: locate-checkpatch
@echo " CHECKING STYLE"
@if test -n "${CHECKPATCH_OPTS}"; then \
echo " with ${CHECKPATCH_OPTS} option(s)"; \
fi
${Q}COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \
for commit in `git rev-list $$COMMON_COMMIT..HEAD`; do \
printf "\n[*] Checking style of '$$commit'\n\n"; \
git log --format=email "$$commit~..$$commit" \
-- ${CHECK_PATHS} | ${CHECKPATCH} - || true; \
-- ${CHECK_PATHS} | \
${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \
git diff --format=email "$$commit~..$$commit" \
-- ${CHECK_PATHS} | ${CHECKPATCH} - || true; \
-- ${CHECK_PATHS} | \
${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \
done
certtool: ${CRTTOOL}

Loading…
Cancel
Save