-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: add new ChopEnd and ChopStart string helpers #591
feat: add new ChopEnd and ChopStart string helpers #591
Conversation
Warning Rate limit exceeded@shayan-yousefi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 33 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent changes enhance the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #591 +/- ##
==========================================
+ Coverage 70.05% 70.09% +0.03%
==========================================
Files 182 182
Lines 11288 11302 +14
==========================================
+ Hits 7908 7922 +14
Misses 2805 2805
Partials 575 575 ☔ View full report in Codecov by Sentry. |
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.
They seem the same as LTrim
and RTrim
. Are they?
ChopStart and ChopEnd can remove one or more strings from the left or right end, respectively, whereas Ltrim and Rtrim always remove a single string. I committed another change to do trim with Golang's built-in TrimLeft and TrimRight functions. edit: |
Got it, one more question, I noticed this PR is going to merged to v1.14.x, but we only release new versions to fix bug. Do you have any special needs, please? |
May I be wrong? I read documentation for contribute, saw: But this was my question too, should I open it on the master? |
Sure, please use the master branch. Sorry for the confusion, I'll update the guide. |
b2a23f3
to
2135878
Compare
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- support/str/str.go (1 hunks)
- support/str/str_test.go (1 hunks)
Additional comments not posted (2)
support/str/str_test.go (2)
1033-1039
: Test cases forChopStart
are comprehensive and well-structured.The test cases effectively cover various scenarios, ensuring the
ChopStart
method functions as expected.
1041-1047
: Test cases forChopEnd
are comprehensive and well-structured.The test cases effectively cover various scenarios, ensuring the
ChopEnd
method functions as expected.
thanks, I changed the base branch to master. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- support/str/str.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- support/str/str.go
@shayan-yousefi It would be better if you can add these methods at their alphabetical position. |
…fi/goravel-framework into feat/add-chop-end-and-start
@kkumar-gcc done ✅ |
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.
Great PR!! Thanks for your contribution.
How can I resolve this? I can't see resolve button 😅 |
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.
Great PR 👍 Added you to the contributor list.
Looking forward to more PRs from you 👍 |
📑 Description
In this pull request, I have added two new string helper methods, chopStart and chopEnd, to Goravel. These methods are inspired by the corresponding Laravel string helpers.
For more details, refer to the official Laravel documentation: String Helpers - chopStart and chopEnd.
Summary by CodeRabbit
New Features
ChopEnd
method to remove specified strings from the end of a string.ChopStart
method to remove specified strings from the beginning of a string.Tests
TestChopStart
to validate the behavior of theChopStart
method.TestChopEnd
to validate the behavior of theChopEnd
method.✅ Checks