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

Utils/PathHelper: split normalize_path() method #343

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Nov 20, 2023

... into a normalize_absolute_path() and a normalize_relative_path() method.

Linux paths are expected to start with a leading slash and functions like file_exists() will not work correctly without it. So... leading slashes should not be removed from absolute paths, but should be removed from relative paths (to allow for easy concatenation).

Splitting the method and using the appropriate version in all the right places should fix this.

Includes updated the tests.
Includes updating function calls to the method.

... into a `normalize_absolute_path()` and a `normalize_relative_path()` method.

Linux paths are expected to start with a leading slash and functions like `file_exists()` will not work correctly without it.
So... leading slashes should not be removed from absolute paths, but should be removed from relative paths (to allow for easy concatenation).

Splitting the method and using the appropriate version in all the right places should fix this.

Includes updated the tests.
Includes updating function calls to the method.
@coveralls
Copy link

Coverage Status

coverage: 98.615% (-0.002%) from 98.617%
when pulling 7690f3c on JRF/pathhelpers-split-normalize-method
into e6c1b98 on develop.

@jrfnl jrfnl merged commit 30f8b1b into develop Nov 20, 2023
25 checks passed
@jrfnl jrfnl deleted the JRF/pathhelpers-split-normalize-method branch November 20, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants