Skip to content
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

Improvements to TextUtil #125

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improvements to TextUtil #125

wants to merge 2 commits into from

Conversation

kaylendog
Copy link
Collaborator

Copy link
Collaborator Author

@kaylendog kaylendog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly a little tired after reviewing the wrong pr for half an hour but this looks okay

import org.apache.tools.ant.filters.ReplaceTokens

// Define the map containing the tokens we want to replace
def tokensMap = [
BUILDINFO_VERSION: project.rootProject.version,
BUILDINFO_VERSION : project.rootProject.version,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird formatting, but I will let it pass.

@@ -1,9 +1,26 @@
buildscript {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing you discussed this with @Prouser123 - gets the okay from me if he approves.

import javax.lang.model.element.Modifier
import java.text.SimpleDateFormat

task DoBuildInfo {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems more suited to #101?


@Test
void prettifyText() {
Arrays.asList(TextUtil.prettifyText("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "al;ksjfuej;iajdf;luwpqo4q394utp98&(*&)(*")).forEach(System.out::println);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lmao this is hot

implementation "com.google.code.gson:gson:2.8.6"
api "com.google.code.gson:gson:2.8.6"
compileOnly "com.google.code.gson:gson:2.8.6"
implementation("de.skuzzle:semantic-version:2.1.0")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for, aside from the blindingly obvious?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't compile until I did that and idk why until I funfuck gradle

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment refers to line 40 btw - guessing it's just a semver package but worth consulting @Prouser123 about modifying the build file if you haven't already.

@aakatz3
Copy link
Collaborator

aakatz3 commented Apr 20, 2021

It's for koda

@kaylendog
Copy link
Collaborator Author

Yes but what does it do

@kaylendog
Copy link
Collaborator Author

Fixes kokumaji/warrior-plugin#7

Copy link
Collaborator Author

@kaylendog kaylendog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think more comments, in general, would be helpful to developers who are new to this codebase which will make it easier to maintain in the future.

return getStringWidth(text, false);

@SuppressWarnings("UnusedReturnValue")
private static final class ChatFormatStack {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal comment here would be nice, just so us dumb developers can work out what it does.

@kaylendog kaylendog changed the title What does this do Improvements to TextUtil Apr 20, 2021
@aakatz3
Copy link
Collaborator

aakatz3 commented Apr 20, 2021

Need to split some of the gradle stuff out, and there are more things to add to text util.

@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #125 (64fa9e8) into master (e8131f5) will increase coverage by 0.77%.
The diff coverage is 55.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   34.51%   35.28%   +0.77%     
==========================================
  Files          63       64       +1     
  Lines        2532     2590      +58     
  Branches      286      297      +11     
==========================================
+ Hits          874      914      +40     
- Misses       1595     1608      +13     
- Partials       63       68       +5     
Impacted Files Coverage Δ
...mmon/src/main/java/com/dumbdogdiner/BuildInfo.java 0.00% <0.00%> (ø)
...m/dumbdogdiner/stickyapi/common/util/TextUtil.java 60.97% <64.40%> (+30.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8131f5...64fa9e8. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants