Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused_import not taking into account @_exported import #5528

Open
2 tasks done
NachoSoto opened this issue Apr 7, 2024 · 0 comments
Open
2 tasks done

unused_import not taking into account @_exported import #5528

NachoSoto opened this issue Apr 7, 2024 · 0 comments
Labels

Comments

@NachoSoto
Copy link
Contributor

New Issue Checklist

Describe the bug

I'm running into the exact same as #2877. I see there were a few improvements to this in 0.54, but with a multi-module setup like in #2877, import A is removed when the code depends on symbols from B. Similarly, code that depends on CoreFoundation (for example, CGFloat), but only imports Foundation gets this import removed.

Complete output when running SwiftLint, including the stack trace and command used

I haven't tried a small repro project, and this is currently happening in a large project so the output is very long. This is the command:

$ xcodebuild -configuration Debug -workspace ${WORKSPACE} -scheme ${SCHEME} -destination 'generic/platform=iOS' | tee build.log
$ swiftlint analyze --compiler-log-path build.log --fix

Environment

  • SwiftLint version: 0.54.0
  • Installation method used: from GitHub release (since 0.54 is not available on Homebrew)
  • Paste your configuration file:
analyzer_rules:
  - unused_import
Xcode 15.2
Build version 15C500b
  • Do you have a sample that shows the issue?
// This is removed
import Foundation

public func method(_ value: CGFloat) {}
@SimplyDanny SimplyDanny added the bug label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants