Whamcloud - gitweb
LU-13726 build: fix checkpatch fix matching 93/58593/4
authorAndreas Dilger <adilger@whamcloud.com>
Sun, 30 Mar 2025 18:38:38 +0000 (12:38 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Apr 2025 00:55:26 +0000 (00:55 +0000)
commita4aad57a192f1eebce777b90d43e80d7a71d739c
tree0ea1f58ada2f704b65a47f54f370254fba5b1492
parent62276528bafd4a26885991478e577bad44901871
LU-13726 build: fix checkpatch fix matching

When the spelling.txt suspect string is a regexp, then the matched
$typo string is different from the regexp, and is not a valid key
in the $spelling_fix associative array. This generates an error:

    WARNING: 'foo' may be misspelled - perhaps 'CHECKPATCH ERROR'

because $typo is not found in $spelling_fix and $typo_fix is empty.

If $typo_fix is empty after lookup, iterate the $spelling_fix keys
to find the one matching $typo so that it can be used as $typo_fix.

Avoid length warnings from DNAME usage, improve spelling suggestion.

Test-Parameters: trivial
Fixes: d097fcc51b ("LU-18810 obd: add a parameter to enable filename encoding")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6d29f9470d16c340ebf5bcd2384b477bac500c13
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58593
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Colin Faber <cfaber@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/scripts/checkpatch.pl
contrib/scripts/spelling.txt