]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
checkpatch: allow passing config directory
authorPetr Vorel <pvorel@suse.cz>
Tue, 21 Apr 2026 21:14:06 +0000 (23:14 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:24:39 +0000 (21:24 -0700)
commit2ddfdfe1ad31ba5be5a1c3b4b2b950cf6b6d7c35
tree2aea7db4182ac74975bb0ef46bdd64c64d06539c
parentf7027ed76dfcf4905225272029a83cc74fd1816d
checkpatch: allow passing config directory

checkpatch.pl searches for .checkpatch.conf in $CWD, $HOME and
$CWD/.scripts.  Allow passing a single directory via CHECKPATCH_CONFIG_DIR
environment variable (empty value is ignored).  This allows to directly
use project configuration file for projects which vendored checkpatch.pl
(e.g.  LTP or u-boot).

Although it'd be more convenient for user to have --conf-dir option
(instead of using environment variable), code would get ugly because
options from the configuration file needs to be read before processing
command line options with Getopt::Long.

While at it, document directories and environment variable in -h help
and HTML doc.

Link: https://lore.kernel.org/20260421211408.383972-1-pvorel@suse.cz
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/dev-tools/checkpatch.rst
scripts/checkpatch.pl