isnt() is a valid test function, but codespell thinks it is a typo. This adds a -s switch to the qa test tools, to skip the spelling tests.
Created attachment 48765 [details] [review] Add spelling exclusion parameter
It's not really patch 3/3, but I have a couple other tweaks outstanding.
use of debug statements, marked as failed QA. I would not skip this pass, why do you want? It's certainly better to fix the annoying false positive 'isnt' than completely skip the spelling check.
Created attachment 48782 [details] [review] Bug 16003: Add spelling exclusion switch. TEST PLAN --------- Run on a test file with isnt. -- spelling error Patch Run on the same file with a -s -- spelling tests skipped.
(In reply to Jonathan Druart from comment #3) > use of debug statements, marked as failed QA. DOH! Valid point. > I would not skip this pass, why do you want? Because I rather see SKIPPED than FAILED, when there is a false positive. Additionally, adding the -s is more typing. Most people won't, like they shouldn't. > It's certainly better to fix the annoying false positive 'isnt' than > completely skip the spelling check. I concede that is the better solution. However, since I don't know how to do that, I did what I know how to do as of this moment.
Created attachment 48791 [details] [review] Bug 16003 - Add exceptions file logic to codespell call I created an exceptions file by: $ git grep "isnt(" | cut -f2- -d":" | sort -u > ~/qa-test-tools/spelling.exceptions I then patched QohA/File.pm to include a -x extension to the codespell call if the exceptions file existed. TEST PLAN --------- In your koha development directory apply bug 15870 run the koha qa test tools -- you will get a complaint about isnt(, likely because it is tokenized as isnt. apply this patch to your qa test tools run the koha qa test tools on bug 15870 again -- spelling issue passed! THIS IS A COUNTER PATCH.
Created attachment 48839 [details] [review] Bug 16003: Add exception pattern list for codespell checks
Mark, Please have a look at this patch. I think it does what you want but in a more flexible way: we won't blacklist an entire file, but just a line.
Created attachment 48864 [details] [review] [SIGNED-OFF] Bug 16003: Add exception pattern list for codespell checks The 'isnt' Test::More subroutine should not be considered as a failure by the codespell check. To avoid that this patch introduces the concept of "exception patterns" for this check. NOTE: This is better than introducing a '-x {exception file}', because it dynamically handles the isnt( issue. If other similar function name issues arise in the future, modifications to the i_dont_fail_spelling.pl file and the exception list can be made. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Pushed, thanks Mark for the signoff.