SyntaxCheck: fix regex that comments out 'use' lines
There are false positive violations from OTOBO::Perl::SyntaxCheck
. E.g.
[checked] scripts/test/Event/Escalations.t
[33mTidyAll::Plugin::OTOBO::Perl::SyntaxCheck[0m
[31mGlobal symbol "$Self" requires explicit package name (did you forget to declare "my $Self"?) at /tmp/WHIr3kc5sh line 94.
Global symbol "$Self" requires explicit package name (did you forget to declare "my $Self"?) at /tmp/WHIr3kc5sh line 109.
Global symbol "$Self" requires explicit package name (did you forget to declare "my $Self"?) at /tmp/WHIr3kc5sh line 187.
Global symbol "$Self" requires explicit package name (did you forget to declare "my $Self"?) at /tmp/WHIr3kc5sh line 194.
Global symbol "$Self" requires explicit package name (did you forget to declare "my $Self"?) at /tmp/WHIr3kc5sh line 195.
The checked code is:
# OTOBO modules
use Kernel::System::UnitTest::MockTime qw(:all);
use Kernel::System::UnitTest::RegisterDriver; # set up $Self and $Kernel::OM
our $Self;
SyntaxCheck comments out use Statements. The problem is that the policy comments out too many lines, as it checks for a ;
at the end of the line. In this cast this includes the line that declares $Self
.
TODO;
-
accept a semicolon followed by a comment