Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer use 'use vars' #2174

Closed
bschmalhofer opened this issue Feb 18, 2023 · 2 comments
Closed

No longer use 'use vars' #2174

bschmalhofer opened this issue Feb 18, 2023 · 2 comments
Assignees
Labels
tidying Tidying of the code
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Feb 18, 2023

Handle the fallout from https://github.com/RotherOSS/CodePolicy/issues/102 which prohibits 'use vars'.
This is mostly relevant for the test scripts. In the code itself there is only a single occurence.

bes:~/devel/OTOBO/otobo (rel-11_0)$ grep -r 'use\s\+vars' Kernel/ bin/ scripts/ | grep -v cpan-lib | grep -v scripts/test
Kernel/System/Console/Command/Maint/GenericAgent/Run.pm:use vars qw(%Jobs);
Kernel/System/Console/Command/Dev/Code/Generate/UnitTest/Backend/Backend.t.skel:use vars (qw($Self));
Kernel/System/Console/Command/Dev/Code/Generate/ConsoleCommand/ConsoleCommand.t.skel:use vars (qw($Self));

@bschmalhofer bschmalhofer added the tidying Tidying of the code label Feb 18, 2023
@bschmalhofer bschmalhofer added this to the OTOBO 11.0 milestone Feb 18, 2023
@bschmalhofer bschmalhofer self-assigned this Feb 18, 2023
@bschmalhofer
Copy link
Contributor Author

Use the following command for batch editing the test scripts:

grep -rl 'use vars (qw($Self))' scripts/test/ | xargs -L 1 -- perl -pi -E 's/use vars \(qw\(\$Self\)\)/our \$Self/'

bschmalhofer added a commit that referenced this issue Feb 18, 2023
instead of using 'use vars'
bschmalhofer added a commit that referenced this issue Feb 18, 2023
The skeletons are no longer using 'use vars'.
The skeletons are modernized, also use Test2::V0.
bschmalhofer added a commit that referenced this issue Feb 18, 2023
as suggested by Perl::Tidy.
@bschmalhofer
Copy link
Contributor Author

PR is merged and the unittests in rel-11_0 look fine. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidying Tidying of the code
Projects
None yet
Development

No branches or pull requests

1 participant