SwiftLint
SwiftLint copied to clipboard
lint with use-script-input-files option hangs when non existing file passed
New Issue Checklist
- [x] Updated SwiftLint to the latest version
- [x] I searched for existing GitHub issues
Describe the bug
When a non existing file is getting passed into swiftlint, I expect it to return some error code, but it just hangs and doesn't return.
Complete output when running SwiftLint, including the stack trace and command used
$ SCRIPT_INPUT_FILE_0=nonExistingFile.swift SCRIPT_INPUT_FILE_COUNT=1 swiftlint lint --use-script-input-files
Linting 'nonExistingFile.swift' (1/1)
SourceKittenFramework/File.swift:20: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=260 "The file “nonExistingFile.swift” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/phil/Developer/Cupixel/cupixel-studio-ios-pre/nonExistingFile.swift, NSUnderlyingError=0x600002e2c630 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
^C
Environment
- SwiftLint version (run
swiftlint versionto be sure)? 0.47.1 - Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew, M1 based mac.
- Paste your configuration file: problem occurs with an empty config file
- Which Xcode version are you using (check
xcodebuild -version)? Xcode 13.3.1, Build version 13E500a