-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improve Embeds, Major Refactor/Cleanup #138
base: master
Are you sure you want to change the base?
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.
Just some comments
StringBuilder descriptionBuilder = new StringBuilder(); | ||
for (Map.Entry<String, String> entry : matrixConfiguration.getCombination().entrySet()) | ||
descriptionBuilder.append(String.format("- %s: %s", entry.getKey(), entry.getValue())) | ||
.append('\n'); |
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.
Wouldn't it be simpler to use a StringJoiner("\n")
here instead of a StringBuilder that will have a trailing newline?
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.
I just prefer StringBuilder
as everyone is able to immediately recognize what it is. Even as someone who is rather experienced with java, I did not initially recognize StringJoiner
as being a class in the standard library. But if desired, I could replace it with StringJoiner
. I would however personally prefer StringBuilder
.
StringBuilder changesDescription = new StringBuilder(); | ||
for (String changeEntry : changesList) | ||
changesDescription.append(changeEntry) | ||
.append('\n'); |
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.
See previous comment.
src/main/java/nz/co/jammehcow/jenkinsdiscord/util/EmbedUtil.java
Outdated
Show resolved
Hide resolved
Signed-off-by: solonovamax <[email protected]>
Improves embeds and a major refactor/cleanup of basically everything.
This improves embeds based off of the suggestions provided via #27
Here's a list of relevant issues
Here are the changes to the embed:
For the refactors/cleanup:
Testing done
Honestly I have no clue how to do testing with Jenkins plugins. Would love feedback for that if tests are needed, however since there were already basically no tests I felt it wasn't super needed.
Submitter checklist