Repository navigation
Ignore prefer_self_in_static_references rule in extensions generally - #3813
Merged
jpsim merged 1 commit intoJan 24, 2022
Merged
Conversation
SimplyDanny
force-pushed
the
ignore-prefer-self-rule-in-extensions
branch
from
January 23, 2022 16:20
cf4e3dc to
75b18ba
Compare
SimplyDanny
force-pushed
the
ignore-prefer-self-rule-in-extensions
branch
from
January 23, 2022 16:49
75b18ba to
489d6ac
Compare
SimplyDanny
force-pushed
the
ignore-prefer-self-rule-in-extensions
branch
from
January 23, 2022 17:43
489d6ac to
a77af1a
Compare
Collaborator
No it can't because that information is only available in the post-typechecked AST, and SwiftLint lint rules operate on the pre-typechecked AST. Only SwiftLint analyzer rules have access to the post-typechecked AST. |
rcole34
pushed a commit
to rcole34/SwiftLint
that referenced
this pull request
Feb 22, 2022
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3775. The issue is that SourceKitten cannot tell whether an extension extends a class, a struct or an enum. Or can it somehow? 🤔
To make it safe, it's better to ignore the rule in extensions completely for the time being.