[PATCH 1/2] checkpatch: Document config file in help
From: Petr Vorel
Date: Mon Feb 02 2026 - 09:47:44 EST
Signed-off-by: Petr Vorel <pvorel@xxxxxxx>
---
This can be squashed to the following commit.
I added it separately just in case if following patch will be rejected.
Kind regards,
Petr
scripts/checkpatch.pl | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e56374662ff79..8fffdf9e7f85f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -57,6 +57,7 @@ my %ignore_type = ();
my @ignore = ();
my $help = 0;
my $configuration_file = ".checkpatch.conf";
+my $def_configuration_dirs = ".:$ENV{HOME}:.scripts";
my $max_line_length = 100;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
@@ -146,6 +147,9 @@ Options:
-h, --help, --version display this help and exit
When FILE is - read standard input.
+
+Script searches for a configuration file $configuration_file in path:
+$def_configuration_dirs
EOM
exit($exitcode);
@@ -237,7 +241,7 @@ sub list_types {
exit($exitcode);
}
-my $conf = which_conf($configuration_file);
+my $conf = which_conf($configuration_file, $def_configuration_dirs);
if (-f $conf) {
my @conf_args;
open(my $conffile, '<', "$conf")
@@ -1530,9 +1534,9 @@ sub which {
}
sub which_conf {
- my ($conf) = @_;
+ my ($conf, $dirs) = @_;
- foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
+ foreach my $path (split(/:/, $dirs)) {
if (-e "$path/$conf") {
return "$path/$conf";
}
--
2.51.0