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

Comply with the Perl::Critic policy BuiltinFunctions::ProhibitStringySplit #2046

Closed
bschmalhofer opened this issue Dec 19, 2022 · 3 comments
Closed
Labels
good first issue Good for newcomers tidying Tidying of the code
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Dec 19, 2022

A quick test showed that activating the policy BuiltinFunctions::ProhibitStringySplit in CodePolicy reported only 108 violations. Thus it was accepted as a policy that should be activated. When fixing violation the following special case of split have to be considered.

  • ' '; single space removes leading whitespace and splits on continguous whitespace

Originally posted by @bschmalhofer in https://github.com/RotherOSS/CodePolicy/issues/89#issuecomment-1357315501

@bschmalhofer bschmalhofer changed the title Comply with the Perl::Criitc policy BuiltinFunctions::ProhibitStringyEval Comply with the Perl::Critic policy BuiltinFunctions::ProhibitStringyEval Dec 19, 2022
@bschmalhofer bschmalhofer added tidying Tidying of the code good first issue Good for newcomers labels Dec 19, 2022
@bschmalhofer bschmalhofer added this to the OTOBO 11.0 milestone Dec 19, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
The cases where no metacharacters or special cases are involved.
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
Replacing '\.' with /\./.
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
bschmalhofer added a commit that referenced this issue Dec 20, 2022
@bschmalhofer
Copy link
Contributor Author

The stringy splits are now avoided. Closing this issue.

@bschmalhofer bschmalhofer changed the title Comply with the Perl::Critic policy BuiltinFunctions::ProhibitStringyEval Comply with the Perl::Critic policy BuiltinFunctions::ProhibitStringySplit May 20, 2023
@bschmalhofer
Copy link
Contributor Author

Edited the title and the description. This was about ProhibitStringySplit, not ProhibitStringyEval.

https://metacpan.org/dist/Perl-Critic/source/lib/Perl/Critic/Policy/BuiltinFunctions/ProhibitStringyEval.pm has the highest severity already by default.

@bschmalhofer
Copy link
Contributor Author

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

No branches or pull requests

1 participant