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 twitter compose rules check #831

Open
luizgrp opened this issue Dec 13, 2022 · 5 comments
Open

Add twitter compose rules check #831

luizgrp opened this issue Dec 13, 2022 · 5 comments
Labels
Build CI Build or CI related

Comments

@luizgrp
Copy link
Member

luizgrp commented Dec 13, 2022

WHAT

Change our builds scripts to run Twitter's Jetpack Compose Rules.

WHY

So issues like #830 and #611 are detected via code analysis instead of relying on code reviews.

HOW

The ideal would be to add the plugin with spotless but it is not supported. So this ticket is to figure out a good alternative.


Below is some context from my findings in #610:

Kolinter could be added as temporary measure but it does not support baselines. That would force us to fix all the issues in order to add the plugin, which is not great, or suppress each of them with annotations if possible, which is also not great as it would pollute the code.

Ktlint-gradle could be used, but its version would have to be downgraded in our project as the latest version is not currently supported. If proceeding with this option, then ktlint would have to be removed from our spotless configuration, in order to not run twice.

In overall, if we are going to add a different code analysis tool, I would prefer, if possible, to remove spotless in order to have only a single tool. Our project seems to use spotless for code analysis for the reasons below, so any alternative explored would have to provide the same functionalities:

@luizgrp luizgrp added the Build CI Build or CI related label Dec 14, 2022
@yschimke
Copy link
Collaborator

yschimke commented Feb 9, 2023

Maybe moved to https://github.com/mrmans0n/compose-rules?

@luizgrp
Copy link
Member Author

luizgrp commented Feb 9, 2023

Another alternative setup to try: https://github.com/slackhq/compose-lints/

@mrmans0n
Copy link

Apparently now ktlint-gradle works well (instead of kotlinter) with the latest ktlint version, if you go the ktlint route. They updated it not so long ago.

@Goooler
Copy link

Goooler commented Nov 22, 2023

This support has been finished in diffplug/spotless#1896, we can try Spotless integration once 6.23.0 is out.

@yschimke
Copy link
Collaborator

Maybe https://github.com/j-roskopf/ComposeGuard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build CI Build or CI related
Projects
None yet
Development

No branches or pull requests

4 participants