-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Unfortunately, package names containing a dash, like e.g. 'Statistics-ExtendedQueueStats', do have a few pitfalls.
Perl package names must not contain a dash. As some file types usually contain the package name by convention, this might affect (but not limited to):
Kernel/Language/<language_Abbreviation>_<PackageName>.pmvar/packagesetup/<PackageName>.pm
First implication is that a proper perl language server will warn about invalid package name (not sure if CodePolicy does this), and following an adaption there, CodePolicy will catch mismatches between package name and file name - both together are in my opinion sufficient for Point 1.
By far more nasty is point 2. Here, a proper language server will as well warn you about an invalid package name and CodePolicy about naming mismatch, but usually Code(Install|Reinstall|Uninstall|Update) fragments rely upon the packagesetup file name being identical to the package name:
<CodeInstall Type="post"><![CDATA[
# create the package name
my $CodeModule = 'var::packagesetup::' . $Param{Structure}->{Name}->{Content};
$Kernel::OM->Get($CodeModule)->CodeInstall();
]]></CodeInstall>
Here, you do not get warned that the exact package does not exist anymore in any way, which I consider a mean and nasty thing. I'd find it nice if CodePolicy would check if a package name contains a dash and if so, if the Code blocks are handled properly.