New Issue Checklist
Describe the bug
Running swiftlint analyze does not detect issues, but shows error Could not get cursor info. It can be reproduced with very simple freshly generated Xcode project (I have created SwiftlintExample project and added AnalyzeClass.swift with unused import and unused class to trigger detection).
$ xcodebuild -project SwiftlintExample.xcodeproj -scheme SwiftlintExample > xcodebuild.log
Complete output when running SwiftLint, including the stack trace and command used
$ ❯ swiftlint analyze --compiler-log-path xcodebuild.log
Loading configuration from '.swiftlint.yml'
Analyzing Swift files at paths
Collecting 'SwiftlintExampleApp.swift' (1/3)
Collecting 'ContentView.swift' (2/3)
Collecting 'AnalyzeClass.swift' (3/3)
Could not index file at path '<path>/SwiftlintExample/SwiftlintExample/AnalyzeClass.swift' with the unused_declaration rule.
Could not index file at path '<path>/SwiftlintExample/SwiftlintExample/SwiftlintExampleApp.swift' with the unused_declaration rule.
Could not index file at path '<path>/SwiftlintExample/SwiftlintExample/ContentView.swift' with the unused_declaration rule.
Analyzing 'SwiftlintExampleApp.swift' (1/3)
Analyzing 'AnalyzeClass.swift' (2/3)
Analyzing 'ContentView.swift' (3/3)
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Could not get cursor info
Done analyzing! Found 0 violations, 0 serious in 3 files.
Environment
- SwiftLint version (run
swiftlint version to be sure)? 0.40.3
- Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
- Paste your configuration file:
included:
- SwiftlintExample
analyzer_rules:
- unused_declaration
- unused_import
- Are you using nested configurations? NO
If so, paste their relative paths and respective contents.
- Which Xcode version are you using (check
xcodebuild -version)? Xcode 12.0 / Build version 12A7209
- Do you have a sample that shows the issue? Run
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
New Issue Checklist
Describe the bug
Running
swiftlint analyzedoes not detect issues, but shows errorCould not get cursor info. It can be reproduced with very simple freshly generated Xcode project (I have created SwiftlintExample project and added AnalyzeClass.swift with unused import and unused class to trigger detection).$ xcodebuild -project SwiftlintExample.xcodeproj -scheme SwiftlintExample > xcodebuild.logComplete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint versionto be sure)? 0.40.3If so, paste their relative paths and respective contents.
xcodebuild -version)? Xcode 12.0 / Build version 12A7209echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rulesto quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules.