Repository navigation
Conversation
I change the name of the method that writes the tags of a `WeBWorK::Utils::Tags` object to its problem file from `write` to `write_to_file` in openwebwork#3126. However, I didn't change the method name in place where this method was called in the `WeBWorK::Utils::ListingDB` package. As a result writing tags fails. Note that the method name `write` does not pass the `Subroutines::ProhibitBuiltinHomonyms` policy. However, it only fails the policy with the caveat explicitly stated in their documentation which states "It is reasonable to declare an object method with the same name as a Perl built-in function, since they are easily distinguished from each other. However, at this time, Perl::Critic cannot tell whether a subroutine is static or an object method." This is one of my annoyances with that rule. It is generally a good rule, but it can't be implemented well. So the fix implemented here is to rename the method back to `write`, since it is a perfectly good object method name, and add `## no critic (Subroutines::ProhibitBuiltinHomonyms)` to the line.
somiaj
approved these changes
Oct 10, 2026
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.
I change the name of the method that writes the tags of a
WeBWorK::Utils::Tagsobject to its problem file fromwritetowrite_to_filein #3126. However, I didn't change the method name in place where this method was called in theWeBWorK::Utils::ListingDBpackage. As a result writing tags fails.Note that the method name
writedoes not pass theSubroutines::ProhibitBuiltinHomonymspolicy. However, it only fails the policy with the caveat explicitly stated in their documentation which states "It is reasonable to declare an object method with the same name as a Perl built-in function, since they are easily distinguished from each other. However, at this time, Perl::Critic cannot tell whether a subroutine is static or an object method." This is one of my annoyances with that rule. It is generally a good rule, but it can't be implemented well. So the fix implemented here is to rename the method back towrite, since it is a perfectly good object method name, and add## no critic (Subroutines::ProhibitBuiltinHomonyms)to the line.