nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 640 forks source link

--exclude doesn't work with relative directory #903

Closed superarts closed 3 years ago

superarts commented 3 years ago

I may be missing the obvious here, but commands like this wouldn't work for me:

swiftformat ../../../MyProject/ --exclude ../../../MyProject/Pods/ --lint

While this works:

swiftformat ../../../MyProject/ --exclude ~/prj/ios/MyProject/Pods/ --lint

I'm pretty sure I didn't make any human error here, as ls ../../../MyProject gives me the expected result. I can't see it from the open issues; could anyone confirm if it's a real issue please? I'm on 0.47.12 68cac6de69aafb44b60ae49a919600966b0dcabe.

nicklockwood commented 3 years ago

@superarts this looks like a bug - paths containing ../ aren't correct matched. I'll fix it asap.

superarts commented 3 years ago

Thanks! I am using a combination of pwd and NSString's standardizingPath as a workaround.

nicklockwood commented 3 years ago

@superarts fixed in 0.48.0