From e3be7a39673ec1be60daf2bc45922e67d5b861fb Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 28 Nov 2023 17:31:38 -0700 Subject: [PATCH] fish: kchp: Add flexibility to location of checkpatch.pl It is sometimes helpful to run mainline's checkpatch.pl on stable patches. Signed-off-by: Nathan Chancellor --- fish/functions/kchp.fish | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fish/functions/kchp.fish b/fish/functions/kchp.fish index a69f51b9e..00b5045c0 100644 --- a/fish/functions/kchp.fish +++ b/fish/functions/kchp.fish @@ -3,9 +3,16 @@ # Copyright (C) 2021-2023 Nathan Chancellor function kchp -d "Shorthand for scripts/checkpatch.pl" - if not test -x scripts/checkpatch.pl - print_error "checkpatch.pl does not exist" + if test -n "$CHECKPATCH" + set checkpatch $CHECKPATCH + else + set checkpatch scripts/checkpatch.pl + end + + if not test -x $checkpatch + print_error "$checkpatch does not exist or is not executable?" return 1 end - scripts/checkpatch.pl $argv + + $checkpatch $argv end