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

Sample/documentation to use the lint rules for compose mpp projects #60

Open
sureshg opened this issue Feb 15, 2023 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@sureshg
Copy link

sureshg commented Feb 15, 2023

As per the current documentation, compose-lint should work for non-android projects by adding the following dependency and android lint plugin.

Just add the dependency to the lintChecks configuration. Note for non-android projects, you must apply the com.android.lint Gradle plugin to use this.

dependencies {
  lintChecks("com.slack.lint.compose:compose-lint-checks:<version>")
}

But it's not working as expected for a compose mpp project as it can't find the main sourceset. So it would be great if you can provide some samples/documentation on how to configure this lint rules for compose mpp projects.

@ZacSweers
Copy link
Collaborator

ZacSweers commented Feb 15, 2023

PRs welcome, I've never tried to apply it in a multiplatform project so I don't know off-hand. non-android really kinda means just jvm projects in this context, I'm not sure lint supports multiplatform.

@ZacSweers ZacSweers added the help wanted Extra attention is needed label Feb 18, 2023
@ZacSweers
Copy link
Collaborator

Redwood may have some solutions

so the setup for multiplatform, js, jvm, and android kotlin plugins are all here: https://github.com/cashapp/redwood/blob/65be6c3ceec60d8b44eb304af8e93584ce3641fb/redwood-gradle-plugin/src/main/kotlin/app/cash/redwood/gradle/RedwoodLintPlugin.kt.

the task is in there as well, although it just forks a JVM to run the CLI which depends on lint. The lint setup within the CLI is here: https://github.com/cashapp/redwood/blob/65be6c3ceec60d8b44eb304af8e93584ce3641fb/redwood-cli/src/main/kotlin/app/cash/redwood/cli/LintCommand.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants