Subject: | use_strict metric issues uninitialized warning when modules are missing |
xt/release/kwalitee.t ............. 1/?
# Failed test 'use_strict'
# at xt/release/kwalitee.t line 4.
# Error: This distribution does not 'use strict;' (or its equivalents) in all of its modules. Note that this is not about the actual strictness of the modules. It's bad if nobody can tell whether the modules are strictly written or no
t, without reading the source code of your favorite clever module that actually enforces strictness. In other words, it's bad if someone feels the need to add 'use strict' to the modules.
Use of uninitialized value in concatenation (.) or string at /Users/ether/.perlbrew/libs/19.7@std/lib/perl5/Module/CPANTS/Kwalitee/Uses.pm line 158.
# Details:
# The following modules don't use strict (or equivalents):
# Remedy: Add 'use strict' to all modules, or convince us that your favorite module is well-known enough and people can easily see the modules are strictly written.
# Looks like you failed 1 test of 14.
The root problem here was that the 'provides' field in metadata was empty, so MCA thought there were no modules.
The use_strict code in Module/CPANTS/Kwalitee/Uses.pm returns 0 if $d->{modules} is empty, but in this case there is no $d->{error}{use_strict} set, so the actual error message is not correct.
Better would be to have a separate metric for "has modules present" (as every distribution should have at least one), and return success for the use_strict metric in that case.