-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Refactoring CLIRegisterer #4945
Refactoring CLIRegisterer #4945
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer, thanks.
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
logAndPrintError
was extracted (refactored), but its similar class,CLIRegisterer
was 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 entries
section 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 entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).