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

duplicate_imports disabled but still autocorrect removes my import #5418

Closed
2 tasks done
TripwireNL opened this issue Jan 15, 2024 · 0 comments · Fixed by #5432
Closed
2 tasks done

duplicate_imports disabled but still autocorrect removes my import #5418

TripwireNL opened this issue Jan 15, 2024 · 0 comments · Fixed by #5432
Assignees
Labels
bug Unexpected and reproducible misbehavior.

Comments

@TripwireNL
Copy link

TripwireNL commented Jan 15, 2024

New Issue Checklist

I need a specific import class to have some code that for some reason Swift doesn't find when normally importing the package. So I do:

import InspireAPI
import class InspireAPI.Response

This will obviously throw a duplicate_imports warning and will be fixed when running swiftlint --fix.
So I added this:

import InspireAPI
// swiftlint:disable all
import class InspireAPI.Response
// swiftlint:enable all

Or

import InspireAPI
// swiftlint:disable:next duplicate_imports
import class InspireAPI.Response

Yet the import class still gets removed when running swiftlint --fix :(

EDIT:
Hm apparently when doing something like this it works:

// swiftlint:disable all
import Apples
import BlaBla
import Combine
import InspireAPI
import class InspireAPI.Response
import Foundation
// swiftlint:enable all
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Jan 20, 2024
@SimplyDanny SimplyDanny self-assigned this Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants