Repository navigation
Refactoring CLIRegisterer - #4945
Conversation
daniel-beck
left a comment
There was a problem hiding this comment.
Interesting suggestion, thanks for your submission.
I'm unsure whether it is worth it yet. For one thing, the new method has more arguments than lines of code to make it work, effectively reducing readability through an additional level of indirection. Perhaps if it was extended to all error messages rather than two out of seven or so it could be worth it? Log related arguments could be optional, or a new method printError be created that does only this.
|
@daniel-beck Thank you for your comment. Your recommendation sounds very good. I'll add |
|
I've done the modification. Would you check it again? |
|
Looks good in the current state. We may merge it in 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process |
|
Thanks for your contribution @T45K ! Just in case you are interested to submit more patches, the Jenkins project participates in Hacktoberfest this year. https://www.jenkins.io/events/hacktoberfest/ |
In #4641, a method named
logAndPrintErrorwas extracted (refactored), but its similar class,CLIRegistererwas not modified.I refactored the class to make consistent and reduce duplicated code.
This PR is for minor changes without a JIRA ticket.
Proposed changelog entries
N/A
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entriessection only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
N/A
Maintainer checklist
Before the changes are marked as
ready-for-merge:Proposed changelog entriesare correctupgrade-guide-neededlabel is set and there is aProposed upgrade guidelinessection in the PR title. (example)lts-candidateto be considered (see query).