You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.
For showing the errors on Xcode, the printed paths should be absolute and not contain . or .. paths.
The directory parameter in the violations(in directory: URL) is not being used in most cases. The reason for such thing is that the URL(fileURLWithPath: relativePath) function is used to convert a String to a URL. Such initializer, when the path is relative, automatically (and silently) sets the base directory to currentDirectoryPath, leading to an absolute path equal to:
Seems that this is wrong: the path should be relative to the directory parameter. Thus, function URL(fileURLWithPath: relativePath, relativeTo: directory) should be used (only available from .macOS(.v10_11)).
The reason this problem has not been detected in the tests is because the path property in the Resource object was always returning an absolute path.
The reason this problem has not been detected in production is because the currentDirectoryPath is the directory where the .projlint.yml lives, as there is no possibility to specify a custom path for it.
The text was updated successfully, but these errors were encountered:
For showing the errors on Xcode, the printed paths should be absolute and not contain
.
or..
paths.The
directory
parameter in theviolations(in directory: URL)
is not being used in most cases. The reason for such thing is that theURL(fileURLWithPath: relativePath)
function is used to convert aString
to aURL
. Such initializer, when the path is relative, automatically (and silently) sets the base directory tocurrentDirectoryPath
, leading to an absolute path equal to:Seems that this is wrong: the path should be relative to the
directory
parameter. Thus, functionURL(fileURLWithPath: relativePath, relativeTo: directory)
should be used (only available from.macOS(.v10_11)
).The reason this problem has not been detected in the tests is because the
path
property in theResource
object was always returning an absolute path.The reason this problem has not been detected in production is because the
currentDirectoryPath
is the directory where the.projlint.yml
lives, as there is no possibility to specify a custom path for it.The text was updated successfully, but these errors were encountered: