Skip to content

Commit 32f30ca

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: disallow --git and --file/--fix
Don't allow these options to be combined. Miscellanea: o Add missing $P: to some die("reason message") output Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/3dc7bdaa58490f5906efc11a4d6113e42a087723.camel@perches.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a55ee0c commit 32f30ca

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/checkpatch.pl‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ sub list_types {
246246
$fix = 1 if ($fix_inplace);
247247
$check_orig = $check;
248248

249+
die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix));
250+
249251
my $exit = 0;
250252

251253
my $perl_version_ok = 1;
@@ -269,11 +271,11 @@ sub list_types {
269271
} elsif ($color =~ /^auto$/i) {
270272
$color = (-t STDOUT);
271273
} else {
272-
die "Invalid color mode: $color\n";
274+
die "$P: Invalid color mode: $color\n";
273275
}
274276

275277
# skip TAB size 1 to avoid additional checks on $tabsize - 1
276-
die "Invalid TAB size: $tabsize\n" if ($tabsize < 2);
278+
die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2);
277279

278280
sub hash_save_array_words {
279281
my ($hashRef, $arrayRef) = @_;

0 commit comments

Comments
 (0)