public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] checkpatch: Document config file in help
@ 2026-02-02 14:42 Petr Vorel
  2026-02-02 14:42 ` [PATCH 2/2] checkpatch: Add --conf-dir option Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2026-02-02 14:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Petr Vorel, Andy Whitcroft, Joe Perches, Dwaipayan Ray,
	Lukas Bulwahn, Kory Maincent, Tom Rini, Simon Glass,
	Kuan-Wei Chiu

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-02-23 21:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 14:42 [PATCH 1/2] checkpatch: Document config file in help Petr Vorel
2026-02-02 14:42 ` [PATCH 2/2] checkpatch: Add --conf-dir option Petr Vorel
2026-02-20 11:47   ` Petr Vorel
2026-02-20 17:13   ` Joe Perches
2026-02-23 15:53     ` Petr Vorel
2026-02-23 17:08       ` Joe Perches
2026-02-23 21:38         ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox