diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 390ecbb..30b9248 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -51,6 +51,7 @@ my $ignore_perl_version = 0; my $minimum_perl_version = 5.10.0; my $min_conf_desc_length = 4; +my $spelling_warn = 0; my $spelling_file = "$D/spelling.txt"; my $codespell = 0; my $codespellfile = "/usr/share/codespell/dictionary.txt"; @@ -110,6 +111,7 @@ sub help { file. It's your fault if there's no backup or git --ignore-perl-version override checking of perl version. expect runtime errors. + --spelling Warn about typos and spelling problems --codespell Use the codespell dictionary for spelling/typos (default:/usr/share/codespell/dictionary.txt) --codespellfile Use this codespell dictionary @@ -206,6 +208,7 @@ sub list_types { 'ignore-perl-version!' => \$ignore_perl_version, 'debug=s' => \%debug, 'test-only=s' => \$tst_only, + 'spelling!' => \$spelling_warn, 'codespell!' => \$codespell, 'codespellfile=s' => \$codespellfile, 'color!' => \$color, @@ -2663,6 +2666,7 @@ sub process { $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/); my $msg_type = \&WARN; $msg_type = \&CHK if ($file); + $msg_type = \&WARN if ($spelling_warn); if (&{$msg_type}("TYPO_SPELLING", "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $herecurr) && $fix) {