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

Not all transitive references are corrected by require_explicit_imports #3209

Open
kastiglione opened this issue May 16, 2020 · 3 comments
Open
Labels

Comments

@kastiglione
Copy link
Contributor

kastiglione commented May 16, 2020

Describe the bug

We use require_explicit_imports: true, and have some found some cases where SwiftLint does not add imports for transitively used swift modules. The ones I've seen so far are:

  1. Use of functions defined on extensions, where the module that defines the extension is not directly imported by the module that references the extension
  2. Calling functions that have parameters with default values, and where the function/initializer of the default is defined in a module not directly imported
  3. References to type metadata from modules not directly referenced. For example, one case was self.mapView.rx.willMove, and the module that defines the type of willMove was not being directly imported (it may also be relevant that the type of willMove is a generic and it conformed to a protocol)

In these cases, if the import does exist, the unused_import rule will remove it, which prevents manual fixes.

The main purpose of this issue is to see if these have been discussed, and to see if these implicit references are visible from SourceKit. These cases were identified when switching to dynamic linking, instead of static linking.

@keith keith pinned this issue May 16, 2020
@keith keith unpinned this issue May 16, 2020
@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 label Nov 8, 2020
@keith
Copy link
Collaborator

keith commented Nov 9, 2020

Still relevant

@stale stale bot removed the wontfix label Nov 9, 2020
@stale
Copy link

stale bot commented Jan 8, 2021

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 label Jan 8, 2021
@stale stale bot closed this as completed Jan 15, 2021
@jpsim jpsim reopened this Feb 23, 2021
@jpsim jpsim removed the wontfix label Feb 23, 2021
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

4 participants