Re: [PATCH v4 1/2] checkpatch: Allow passing config directory

From: Simon Glass

Date: Thu Apr 16 2026 - 14:44:01 EST


On Thu, 16 Apr 2026 at 02:36, Petr Vorel <pvorel@xxxxxxx> wrote:
>
> checkpatch.pl searches for .checkpatch.conf in $CWD, $HOME and
> $CWD/.scripts. Allow passing a single directory via
> CHECKPATCH_CONFIG_DIR environment variable. 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 add --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 help.
>
> Signed-off-by: Petr Vorel <pvorel@xxxxxxx>
> ---
> NOTE: Feel free to suggest better wording for the help text.
>
> Changes in v4 (all by Simon):
> * Warn when config file is not in directory specified by CHECKPATCH_CONFIG_DIR
> * Fix the directory search order in the commit message.
> * Fix wording commit message ('Allow to pass' -> 'Allow passing')
>
> Link to v3:
> https://lore.kernel.org/lkml/20260408120603.54351-1-pvorel@xxxxxxx/
>
> Link to v2:
> https://lore.kernel.org/lkml/20260224181623.89904-1-pvorel@xxxxxxx/
>
> Link to v1:
> https://lore.kernel.org/lkml/20260202144221.76765-2-pvorel@xxxxxxx/
> scripts/checkpatch.pl | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx>