-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
SwiftLint Incorrectly Flags @Parameter Type Annotation as Redundant in TipKit Integration #5366
Comments
Four options:
I tend towards the third option. More and more attributes are being added to the language, there are property wrappers and now also macros. It's impossible to know which data these attributes require to work. Users know and so they should be able to configure them for exclusion. |
Hi @SimplyDanny Thanks for your quick response! I’m keen on making attributes configurable for SwiftLint as you suggested. Could you share more details or best practices on how to implement this? Your guidance would be really helpful. |
Appreciate your readiness! The rule is called Have fun! PS: In case you are highly motivated, you may even consider rewriting the whole rule using SwiftSyntax. This is a long-term goal of this project. There are not that many rules left to be rewritten but |
Hey, I'm willing to work on this 🙂 |
@tonell-m: Great! Please go ahead. |
New Issue Checklist
Describe the bug
While integrating TipKit, as documented here, a conflict arises with SwiftLint's handling of redundant type annotations. Specifically, SwiftLint incorrectly flags the type annotation in the @parameter attribute as redundant, which, when auto-corrected, leads to a compilation failure.
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint # Output indicating 'redundant_type_annotation' violation for the @Parameter attribute
Environment
Additional Context
SwiftLint's
redundant_type_annotation
rule suggests the removal of the for type annotation in the@Parameter
attribute, which, if applied, results in a compilation error. A temporary workaround is to disable this specific rule using// swiftlint:disable redundant_type_annotation
for the affected line. Are there any better solutions to keep this rule and support macros?The text was updated successfully, but these errors were encountered: