-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
no_magic_numbers rule now ignores violations in Preview macros #5778
no_magic_numbers rule now ignores violations in Preview macros #5778
Conversation
I wonder if we should only ignore the |
So right now, we'd ignore nothing at all by default, although It would be pretty easy to say if you're a child of any struct/class/macro named For a class or struct, there's only going to be one for any given name - I think it feels a bit cleaner for people to just
|
I tend to like a default " |
Source/SwiftLintBuiltInRules/Rules/Idiomatic/NoMagicNumbersRule.swift
Outdated
Show resolved
Hide resolved
5d4c598
to
8c7a03e
Compare
… Preview's to be ignored.
8c7a03e
to
1d5d952
Compare
The question here is more whether we need an option at all. The rule could just ignore |
Not that I know of, but I don't really use macros much myself in my day job. I'll ditch the configuration - we can always add in back in if another use case turns up. |
Addresses #5775
violations of
no_magic_numbers
in SwiftUI's Preview macros (or any macro namedPreview
) will be ignored.