Open
Conversation
drgrice1
reviewed
Mar 26, 2026
Comment on lines
+160
to
+161
| my ($result, $error, $fullerror) = | ||
| $self->PG_macro_file_eval($injected, "injected:$fileName"); |
Member
There was a problem hiding this comment.
This should be
Suggested change
| my ($result, $error, $fullerror) = | |
| $self->PG_macro_file_eval($injected, "injected:$fileName"); | |
| my ($result, $error, $fullerror) = $self->PG_macro_file_eval($injected, "injected:$fileName"); |
That is the reason this is failing the perltidy check.
Comment on lines
+176
to
+177
| @shortenedPaths = map { $_ =~ s|^$templateDirectory|[TMPL]/|; $_ } @shortenedPaths; | ||
| @shortenedPaths = map { $_ =~ s|^$pgDirectory|[PG]/macros/|; $_ } @shortenedPaths; |
Member
There was a problem hiding this comment.
I know that this is the original code, but it should be fixed. It should not modify $_. See https://metacpan.org/release/THALJEF/Perl-Critic-1.06/view/lib/Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm. Yeah, the reason for the policy is moot since the intent is to modify the array element, but then again, it doesn't make sense to make the assignment with that modification either and it is also good to prevent the Perl critic warning.
So could you fix this and change this to
Suggested change
| @shortenedPaths = map { $_ =~ s|^$templateDirectory|[TMPL]/|; $_ } @shortenedPaths; | |
| @shortenedPaths = map { $_ =~ s|^$pgDirectory|[PG]/macros/|; $_ } @shortenedPaths; | |
| @shortenedPaths = map { $_ =~ s|^$templateDirectory|[TMPL]/|r } @shortenedPaths; | |
| @shortenedPaths = map { $_ =~ s|^$pgDirectory|[PG]/macros/|r } @shortenedPaths; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider this as a mechanism to bypass (or roll-your-own) hierarchy of search locations for macro files...
Existing pathways all remain behaviorally consistent, we just skip
findMacroFileif content for a named macro is already provided in the environment hash.