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

require_explicit_imports: true nukes all import headers #3136

Closed
2 tasks done
AdrianBinDC opened this issue Mar 1, 2020 · 5 comments
Closed
2 tasks done

require_explicit_imports: true nukes all import headers #3136

AdrianBinDC opened this issue Mar 1, 2020 · 5 comments
Labels
wontfix Issues that became stale and were auto-closed by a bot.

Comments

@AdrianBinDC
Copy link
Contributor

AdrianBinDC commented Mar 1, 2020

New Issue Checklist

Describe the bug

Typed the following in iTerm:

swiftlint analyze --compiler-log-path ./xcodebuild.log --autocorrect --reporter json > swiftlint.json

I expected unnecessary headers to be removed, leaving only headers that are needed to be kept. In the class in question, there are declarations which use Foundation, so I would expect those to stay.

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

Not finished yet. Looking at changes in Tower as it's going.

Environment

  • SwiftLint version (run swiftlint version to be sure)? Build from repo on local machine with latest PR
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Built from source.
  • Paste your configuration file:
analyzer_rules:
  - unused_import

opt_in_rules:
  - unused_import:
      require_explicit_imports: true
  • Which Xcode version are you using (check xcodebuild -version)? Xcode 11.3.1
@jpsim
Copy link
Collaborator

jpsim commented Mar 1, 2020

I’m sorry you’re seeing this, I haven’t experienced this on the project where I’ve enabled this configuration. Can you please share a sample project that reproduces the issue so I can look into it?

@AdrianBinDC
Copy link
Contributor Author

AdrianBinDC commented Mar 2, 2020

@jpsim Unfortunately, I'm not able to do so. I downloaded the repo locally and I will fiddle around with it as time allows. If I'm able to find the issue, I'll put up a PR.

@AdrianBinDC
Copy link
Contributor Author

What's the best way to debug something like this on actual code? Just do print statements or is there a way to link this up to lldb as you would w/ a iOS project?

@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
@jpsim
Copy link
Collaborator

jpsim commented Feb 23, 2021

Sorry for never answering your last question, but I've documented how I run and debug SwiftLint locally using Xcode here: https://github.com/realm/SwiftLint/blob/master/CONTRIBUTING.md#using-xcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

No branches or pull requests

2 participants