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

Add ComposePreviewNaming rule and support multipreview annotations #93

Merged
merged 2 commits into from Oct 3, 2022

Conversation

mrmans0n
Copy link
Contributor

@mrmans0n mrmans0n commented Oct 3, 2022

Multipreview annotations weren't correctly supported, which caused issues with the ModifierMissing rule. This patch does two things to address that:

  • Have the annotations for multipreviews to be properly named (add Preview/s suffix)
  • Expand the preview checks to look for @Preview / @WhateverPreview(s)

Fixes #91

multipreview annotations weren't correctly supported, which caused issues with the `ModifierMissing` rule.
This patch does two things to address that:

- Have the annotations for multipreviews to be properly named (add Preview/s suffix)
- Expand the preview checks to look for `@Preview` / `@WhateverPreview(s)`

Fixes #91
@@ -14,8 +14,6 @@ class ComposePreviewPublicCheck(config: Config) :
TwitterDetektRule(config),
ComposeKtVisitor by ComposePreviewPublic() {

override val autoCorrect: Boolean = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is on purpose, Detekt is super weird with code changes so in a prior patch I removed them all (if they want autofix people can use detekt-formatting which uses ktlint under the hood) -- but left this one behind by mistake.

@mrmans0n mrmans0n merged commit 698284e into main Oct 3, 2022
@mrmans0n mrmans0n deleted the nacho/naming-previews branch October 3, 2022 12:34
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.

Support Multipreview annotations in ModifierMissing rule
3 participants