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

strip leading and trailing, but do not squash inner whitespaces (#100) #101

Conversation

fupgang
Copy link
Contributor

@fupgang fupgang commented Mar 1, 2024

Fixes #100

Optional stripping of inner whitespaces not implemented.

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.09%. Comparing base (1259b4a) to head (88e6dd8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #101      +/-   ##
============================================
+ Coverage     85.81%   86.09%   +0.27%     
+ Complexity      255      253       -2     
============================================
  Files            27       27              
  Lines           698      683      -15     
  Branches         72       69       -3     
============================================
- Hits            599      588      -11     
+ Misses           75       73       -2     
+ Partials         24       22       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

return sanitizedShortMessage;
final String stripped = sanitizedShortMessage.strip();
if (getMaxShortMessageLength() != 0 && stripped.length() > getMaxShortMessageLength()) {
return stripped.substring(0, getMaxShortMessageLength());
Copy link
Owner

Choose a reason for hiding this comment

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

A message a b with a max length of 5 would be returned as a . This is why I'd first only strip leading whitespaces, then do an optional substring and then the stripping of trailing whitespaces.

@osiegmar
Copy link
Owner

superseded by #102

@osiegmar osiegmar closed this Mar 16, 2024
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.

All newlines in short messages are replaced with whitespaces
2 participants