#!/usr/bin/env bash

set -e

scriptpath=${CHECKPATCH_PATH:-/lib/modules/$(uname -r)/build/scripts}

ignore=(
	MISSING_SIGN_OFF
	EMAIL_SUBJECT
	UNKNOWN_COMMIT_ID
	NO_AUTHOR_SIGN_OFF
	COMMIT_LOG_USE_LINK
	BAD_REPORTED_BY_LINK
	FILE_PATH_CHANGES
	SPDX_LICENSE_TAG
	LINUX_VERSION_CODE
	CONSTANT_COMPARISON
	NEW_TYPEDEFS
	AVOID_BUG
	MACRO_ARG_REUSE
	IF_0
)
ignore_str=${ignore[*]}

${scriptpath}/checkpatch.pl --no-tree --show-types --strict --ignore="${ignore_str// /,}" $@
