-
Notifications
You must be signed in to change notification settings - Fork 56
Simplify removing leading and trailing separators #712
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
base: cottsay/shell-tests
Are you sure you want to change the base?
Conversation
Previously, we checked if the leading or trailing character was a colon and then used a wildcard to remove it. It is simpler to just remove a leading or trailing colon. This has the added benefit of only using shell built-in functions. Co-authored-by: Scott K Logan <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## cottsay/shell-tests #712 +/- ##
====================================================
Coverage 86.98% 86.98%
====================================================
Files 69 69
Lines 4088 4088
Branches 706 706
====================================================
Hits 3556 3556
Misses 421 421
Partials 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cba4e28 to
e31f37f
Compare
|
So this is sort of interesting, because I uncovered some issues in #713 that are solved by this PR, but not because of the lack of It doesn't actually fail, it just doesn't remove the leading/trailing separators like it should. Given that there's actually buggy behavior on a supported platform, I'm a little more motivated to get this pushed through and get #713 merged with some actual tests here. |
knmcguire
left a comment
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've tested out these solutions directly in a bash terminal and I can confirm this working.
Just a comment that it won't remove any double colons before and after the environment variable path string, nor does it remove any double colons in between. But I've learned that this is not really an edge case that has happened before, if at least nobody has reported this at least...
This change is adapted from ament/ament_package#152, authored by @robwoolley.
Requires tests that are added in #713.