-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix PreviewPublicDetector #206
Conversation
Resolves #189
@@ -30,6 +31,7 @@ class PreviewPublicDetectorTest : BaseSlackLintTest() { | |||
lint().files(kotlin(code)).allowCompilationErrors().run().expectClean() | |||
} | |||
|
|||
@Ignore("TODO code review") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrmans0n @chrisbanes I was surprised to find this test that starts failing after the fix. The test seems to disagree with the check's stated purpose, do you have more details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I assume the second function declaration is a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to remember why this was done... but I can't recall exactly. The idea I think was around previews being alright being public, private or whatever unless they had an annotated param for stub preview data (which made them stupid to be public then). But the meaning of the rule changed over time (adding a param to control this was added, many behavior changes happened later).
In the end I simplified it to just check for public + preview, and ignore everything else in my repo https://github.com/mrmans0n/compose-rules/blob/main/rules/common/src/main/kotlin/io/nlopez/compose/rules/PreviewPublic.kt
You could do the same and call it a day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves #189