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

Fix PreviewPublicDetector #206

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Fix PreviewPublicDetector #206

merged 5 commits into from
Jan 24, 2024

Conversation

ZacSweers
Copy link
Collaborator

Resolves #189

@@ -30,6 +31,7 @@ class PreviewPublicDetectorTest : BaseSlackLintTest() {
lint().files(kotlin(code)).allowCompilationErrors().run().expectClean()
}

@Ignore("TODO code review")
Copy link
Collaborator Author

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?

image

Copy link
Collaborator

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

Copy link
Collaborator

@mrmans0n mrmans0n Nov 27, 2023

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZacSweers ZacSweers enabled auto-merge January 24, 2024 18:26
@ZacSweers ZacSweers added this pull request to the merge queue Jan 24, 2024
Merged via the queue into main with commit a22a0da Jan 24, 2024
2 checks passed
@ZacSweers ZacSweers deleted the z/previewPublic branch January 24, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComposePreviewPublic not working as expected
3 participants