Re: [PATCH v8 1/2] checkpatch: Allow passing config directory
From: Simon Glass
Date: Tue Apr 21 2026 - 19:01:02 EST
On Wed, 22 Apr 2026 at 09:14, 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 (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.
>
> Signed-off-by: Petr Vorel <pvorel@xxxxxxx>
> ---
> Changes in v8 (sashiko):
> * Remove unintentional trailing space in regexp.
>
> Link to v7:
> https://lore.kernel.org/lkml/20260421103851.508142-1-pvorel@xxxxxxx/
>
> Link to v6:
> https://lore.kernel.org/lkml/20260420133014.484162-1-pvorel@xxxxxxx/
>
> Link to v5:
> https://lore.kernel.org/lkml/20260417170346.448758-1-pvorel@xxxxxxx/
>
> Link to v4:
> https://lore.kernel.org/lkml/20260415143636.272605-1-pvorel@xxxxxxx/
>
> 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/
>
> Documentation/dev-tools/checkpatch.rst | 7 +++++++
> scripts/checkpatch.pl | 20 +++++++++++++++++---
> 2 files changed, 24 insertions(+), 3 deletions(-)
>
Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx>