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
The subcommands lint and format have the option --follow-symlinks. However, although it can follow absolute symlinks, it can't follow relative symlinks.
Steps to reproduce
$ mkdir symlink-test
$ cd symlink-test/
$ echo'let foo:Int=0'> .foo.swift
$ ln -s .foo.swift bar.swift
$ swift format dump-configuration > .swift-format
$ cd ..
$ swift format lint -rs --follow-symlinks symlink-test/<unknown>: error: Unable to open .foo.swift: file is not readable or does not exist
If the current working directory is the symlink's directory, it works.
$ cd symlink-test
$ swift format lint -rs --follow-symlinks ..foo.swift:1:9: warning: [Spacing] add 1 space.foo.swift:1:12: warning: [Spacing] add 1 space.foo.swift:1:13: warning: [Spacing] add 1 space
It's because the following line is using relativeTo: workingDirectory.
Description
The subcommands
lint
andformat
have the option--follow-symlinks
. However, although it can follow absolute symlinks, it can't follow relative symlinks.Steps to reproduce
If the current working directory is the symlink's directory, it works.
It's because the following line is using
relativeTo: workingDirectory
.swift-format/Sources/SwiftFormat/Utilities/FileIterator.swift
Line 152 in 8068ff7
Environment
The text was updated successfully, but these errors were encountered: